Re: Samsung/S3C6410/Mini6410: how to handle NAND's "clock off"
On Wednesday 12 November 2014 10:14:58 Uwe Kleine-König wrote: > Hello again, > > [extending audience a bit] > > On Tue, Nov 11, 2014 at 07:42:26PM +0100, Uwe Kleine-König wrote: > > On Tue, Nov 11, 2014 at 07:10:33PM +0100, Juergen Borleis wrote: > > > Hi, > > > > > > the S3C2410 NAND driver [1] can still be used for NANDs attached to an > > > S3C6410 SoC. But this driver has a "nice" feature called "clock off" to > > > save some power while not in use. I tried it here on my Mini6410 > > > platform and it freezes the system. > > > > > > The clock tree is somehow: > > > > > > [...] > > > hclk 44 13300 0 0 > > > hclk_mfc 00 13300 0 0 > > > hclk_mem0 22 13300 0 0 > > > mem0_srom 00 13300 0 0 > > > mem0_nfcon 11 13300 0 0 > > > mem0_onenand0 00 13300 0 0 > > > mem0_onenand1 00 13300 0 0 > > > mem0_cfcon 00 13300 0 0 > > > [...] > > > > > > On the Mini6410 the "mem0_nfcon" clock is the only single user of the > > > "hclk_mem0". And this clock is required to keep the access to the > > > external network device enabled. When the NAND driver disables its > > > clock "mem0_nfcon", the "hclk_mem0" gets also disabled because there is > > > no consumer anymore. The next time the network driver tries to access > > > its device, the SoC freezes. > > > > Sounds like the network driver should hold a reference to hclk_mem0. > > After talking to Jürgen by phone, the solution that the dm9000 driver > should handle the clock sounds wrong. The clk in question is needed by > the SoC to operate the bus the dm9000 is connected to. So I think the > right approach would include I think we need the same here for the S3C6410 SoC, like the imx-weim driver is for i.MX SoCs. jbe -- Pengutronix e.K. | Juergen Borleis | Industrial Linux Solutions | Phone: +49-5121-206917-5128 | Peiner Str. 6-8, 31137 Hildesheim, Germany | Fax: +49-5121-206917- | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ | -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Samsung/S3C6410/Mini6410: how to handle NAND's "clock off"
Hi, the S3C2410 NAND driver [1] can still be used for NANDs attached to an S3C6410 SoC. But this driver has a "nice" feature called "clock off" to save some power while not in use. I tried it here on my Mini6410 platform and it freezes the system. The clock tree is somehow: [...] hclk 44 13300 0 0 hclk_mfc 00 13300 0 0 hclk_mem0 22 13300 0 0 mem0_srom 00 13300 0 0 mem0_nfcon 11 13300 0 0 mem0_onenand0 00 13300 0 0 mem0_onenand1 00 13300 0 0 mem0_cfcon 00 13300 0 0 [...] On the Mini6410 the "mem0_nfcon" clock is the only single user of the "hclk_mem0". And this clock is required to keep the access to the external network device enabled. When the NAND driver disables its clock "mem0_nfcon", the "hclk_mem0" gets also disabled because there is no consumer anymore. The next time the network driver tries to access its device, the SoC freezes. How to prevent this? Can we keep the "hclk_mem0" enabled without an active consumer? Or do we need a dummy consumer? Or do we need to request for "hclk_mem0" when at least one external device is attached? Or should we remove the "clock stop" feature for at least the S3C6410 SoC? With the patch below I was able to reproduce the behavior: Author: Juergen Borleis Date: Mon Nov 10 23:35:06 2014 +0100 ARM/S3C6410/NAND: add clock alias to keep an old driver alive This change enables the existing S3c2410.c driver for the S3C6410. But keep in mind to disable the CONFIG_MTD_NAND_S3C2410_CLKSTOP when using this driver! Why? The access to external devices depends on a running "hclk_mem0" clock. As the NAND controller was the only single user of it, it disables it, when it disables its owm clock to save power. This locks the system. m( Signed-off-by: Juergen Borleis diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index 0f590e5..f7d2d57 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c @@ -404,6 +404,7 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = { ALIAS(PCLK_IIS0, "samsung-i2s.0", "iis"), ALIAS(PCLK_AC97, "samsung-ac97", "ac97"), ALIAS(PCLK_TSADC, "s3c64xx-adc", "adc"), + ALIAS(MEM0_NFCON, NULL, "nand"), ALIAS(PCLK_KEYPAD, "samsung-keypad", "keypad"), ALIAS(PCLK_PCM1, "samsung-pcm.1", "pcm"), ALIAS(PCLK_PCM0, "samsung-pcm.0", "pcm"), jbe [1] drivers/mtd/nand/s3c2410.c -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Samsung S3C6410 SoC/devicetree: how to describe RTC interrupts connected to two different interrupt parents?
Myself wrote: > the Samsung S3C6410 SoC comes with an RTC with two interrupts connected to > two different interrupt controllers. > > The old platform code uses this resource to describe it: > > static struct resource s3c_rtc_resource[] = { > [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC, SZ_256), > [1] = DEFINE_RES_IRQ(IRQ_RTC), <-- channel 2 at VIC0 > [2] = DEFINE_RES_IRQ(IRQ_TICK), <-- channel 28 at VIC1 > }; > > In the devicetree I can define multiple interrupt channels with the > keyword 'interrupts' but it seems all of them must share the same interrupt > parent defined via 'interrupt-parent'. How to handle the special S3C6410 > case? > The file "Documentation/devicetree/bindings/rtc/s3c-rtc.txt" isn't really > helpful. Ahh, "interrupts-extended" is the keyword... solved. jbo -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Samsung S3C6410 SoC/devicetree: how to describe RTC interrupts connected to two different interrupt parents?
Hi, the Samsung S3C6410 SoC comes with an RTC with two interrupts connected to two different interrupt controllers. The old platform code uses this resource to describe it: static struct resource s3c_rtc_resource[] = { [0] = DEFINE_RES_MEM(S3C24XX_PA_RTC, SZ_256), [1] = DEFINE_RES_IRQ(IRQ_RTC), <-- channel 2 at VIC0 [2] = DEFINE_RES_IRQ(IRQ_TICK), <-- channel 28 at VIC1 }; In the devicetree I can define multiple interrupt channels with the keyword 'interrupts' but it seems all of them must share the same interrupt parent defined via 'interrupt-parent'. How to handle the special S3C6410 case? The file "Documentation/devicetree/bindings/rtc/s3c-rtc.txt" isn't really helpful. jbo -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html