[PATCH] pcmcia: fix a boot time warning in pcmcia cs code
During bootup pcmcia (pccardd) code enforces the following warning backtrace: do not call blocking ops when !TASK_RUNNING; state=1 set at [c0319e74] pccardd+0xb8/0x3fc Modules linked in: CPU: 0 PID: 14 Comm: pccardd Not tainted 4.0.0-rc6+ #11 Hardware name: Sharp-Collie [c0105cd8] (unwind_backtrace) from [c0103ef8] (show_stack+0x10/0x14) [c0103ef8] (show_stack) from [c010e9b8] (warn_slowpath_common+0x74/0xac) [c010e9b8] (warn_slowpath_common) from [c010ea20] (warn_slowpath_fmt+0x30/0x40) [c010ea20] (warn_slowpath_fmt) from [c012b1b4] (__might_sleep+0x84/0xa0) [c012b1b4] (__might_sleep) from [c040fbb0] (mutex_lock_nested+0x24/0x388) [c040fbb0] (mutex_lock_nested) from [c0319eb4] (pccardd+0xf8/0x3fc) [c0319eb4] (pccardd) from [c0127370] (kthread+0xdc/0xfc) [c0127370] (kthread) from [c01013a8] (ret_from_fork+0x14/0x2c) ---[ end trace fd94911637eed4ba ]--- This happens due to kthread trying to lock mutex in a TASK_INTERRUPTIBLE state. Limit TASK_INTERRUPTIBLE task state to the schedule() call only, so that the rest of the code runs in TASK_RUNNING state. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/cs.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 5292db6..367d45e 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -626,8 +626,6 @@ static int pccardd(void *__skt) unsigned int events; unsigned int sysfs_events; - set_current_state(TASK_INTERRUPTIBLE); - spin_lock_irqsave(skt-thread_lock, flags); events = skt-thread_events; skt-thread_events = 0; @@ -675,11 +673,15 @@ static int pccardd(void *__skt) if (kthread_should_stop()) break; + set_current_state(TASK_INTERRUPTIBLE); + schedule(); + + /* make sure we are running */ + __set_current_state(TASK_RUNNING); + try_to_freeze(); } - /* make sure we are running before we exit */ - set_current_state(TASK_RUNNING); /* shut down socket, if a device is still present */ if (skt-state SOCKET_PRESENT) { -- 2.1.4 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH V2 3/6] fbdev: sa1100fb: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com Acked-by: Tomi Valkeinen tomi.valkei...@ti.com --- drivers/video/fbdev/sa1100fb.c | 30 +++--- drivers/video/fbdev/sa1100fb.h | 1 + 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 580c444e..2133cf1 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -178,6 +178,7 @@ #include linux/dma-mapping.h #include linux/mutex.h #include linux/io.h +#include linux/clk.h #include video/sa1100fb.h @@ -413,9 +414,9 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var-transp.offset); #ifdef CONFIG_CPU_FREQ - dev_dbg(fbi-dev, dma period = %d ps, clock = %d kHz\n, + dev_dbg(fbi-dev, dma period = %d ps, clock = %ld kHz\n, sa1100fb_display_dma_period(var), - cpufreq_get(smp_processor_id())); + clk_get_rate(fbi-clk) / 1000); #endif return 0; @@ -586,9 +587,10 @@ static struct fb_ops sa1100fb_ops = { * Calculate the PCD value from the clock rate (in picoseconds). * We take account of the PPCR clock setting. */ -static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) +static inline unsigned int get_pcd(struct sa1100fb_info *fbi, + unsigned int pixclock) { - unsigned int pcd = cpuclock / 100; + unsigned int pcd = clk_get_rate(fbi-clk) / 100 / 1000; pcd *= pixclock; pcd /= 1000; @@ -667,7 +669,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ LCCR2_BegFrmDel(var-upper_margin) + LCCR2_EndFrmDel(var-lower_margin); - pcd = get_pcd(var-pixclock, cpufreq_get(0)); + pcd = get_pcd(fbi, var-pixclock); new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi-inf-lccr3 | (var-sync FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | (var-sync FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); @@ -781,6 +783,9 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi) fbi-palette_cpu[0] = 0xcfff; fbi-palette_cpu[0] |= palette_pbs(fbi-fb.var); + /* enable LCD controller clock */ + clk_prepare_enable(fbi-clk); + /* Sequence from 11.7.10 */ writel_relaxed(fbi-reg_lccr3, fbi-base + LCCR3); writel_relaxed(fbi-reg_lccr2, fbi-base + LCCR2); @@ -825,6 +830,9 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi) schedule_timeout(20 * HZ / 1000); remove_wait_queue(fbi-ctrlr_wait, wait); + + /* disable LCD controller clock */ + clk_disable_unprepare(fbi-clk); } /* @@ -1003,7 +1011,6 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); - struct cpufreq_freqs *f = data; u_int pcd; switch (val) { @@ -1012,7 +1019,7 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, break; case CPUFREQ_POSTCHANGE: - pcd = get_pcd(fbi-fb.var.pixclock, f-new); + pcd = get_pcd(fbi, fbi-fb.var.pixclock); fbi-reg_lccr3 = (fbi-reg_lccr3 ~0xff) | LCCR3_PixClkDiv(pcd); set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); break; @@ -1219,6 +1226,13 @@ static int sa1100fb_probe(struct platform_device *pdev) if (!fbi) goto failed; + fbi-clk = clk_get(pdev-dev, NULL); + if (IS_ERR(fbi-clk)) { + ret = PTR_ERR(fbi-clk); + fbi-clk = NULL; + goto failed; + } + fbi-base = ioremap(res-start, resource_size(res)); if (!fbi-base) goto failed; @@ -1271,6 +1285,8 @@ static int sa1100fb_probe(struct platform_device *pdev) failed: if (fbi) iounmap(fbi-base); + if (fbi-clk) + clk_put(fbi-clk); kfree(fbi); release_mem_region(res-start, resource_size(res)); return ret; diff --git a/drivers/video/fbdev/sa1100fb.h b/drivers/video/fbdev/sa1100fb.h index fc5d429..0139d13 100644 --- a/drivers/video/fbdev/sa1100fb.h +++ b/drivers/video/fbdev/sa1100fb.h @@ -68,6 +68,7 @@ struct sa1100fb_info { #endif const struct sa1100fb_mach_info *inf; + struct clk *clk; }; #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) -- 2.1.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH V2 2/6] ARM: sa1100: add a clock alias for sa1111 pcmcia device
SA- uses internal MMIO space offsets as a device name, so device name for sa pcmcia is 1800 (PCMCIA is at offset 0x1800). Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 53f750d..03c75a8 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -124,6 +124,8 @@ static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa1100-rtc, NULL, NULL), CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), + /* sa names devices using internal offsets, PCMCIA is at 0x1800 */ + CLKDEV_INIT(1800, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 2.1.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH V2 6/6] pcmcia: sa1100: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa1100_generic.c | 1 + drivers/pcmcia/sa11xx_base.c| 14 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index ff8a027..d2ab060 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -93,6 +93,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) for (i = 0; i sinfo-nskt; i++) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(sinfo-clk); kfree(sinfo); return 0; } diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 54d3089..cf6de2c 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -135,14 +135,16 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, static int sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) { - return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); + unsigned long clk = clk_get_rate(skt-clk); + + return sa1100_pcmcia_set_mecr(skt, clk / 1000); } static int sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) { struct soc_pcmcia_timing timing; - unsigned int clock = cpufreq_get(0); + unsigned int clock = clk_get_rate(skt-clk); unsigned long mecr = MECR; char *p = buf; @@ -218,6 +220,11 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo; struct soc_pcmcia_socket *skt; int i, ret = 0; + struct clk *clk; + + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) + return PTR_ERR(clk); sa11xx_drv_pcmcia_ops(ops); @@ -226,12 +233,14 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, return -ENOMEM; sinfo-nskt = nr; + sinfo-clk = clk; /* Initialize processor specific parameters */ for (i = 0; i nr; i++) { skt = sinfo-skt[i]; skt-nr = first + i; + skt-clk = clk; soc_pcmcia_init_one(skt, ops, dev); ret = sa11xx_drv_pcmcia_add_one(skt); @@ -242,6 +251,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, if (ret) { while (--i = 0) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(clk); kfree(sinfo); } else { dev_set_drvdata(dev, sinfo); -- 2.1.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH V2 5/6] pcmcia: sa1111: provide device clock
Both pxa2xx (long ago) and sa1100 (now) make use of clock device to get the cpu speed. Make sa glue code provide clock to platform layer. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..7bae7e5 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -145,6 +145,12 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, return -ENOMEM; s-soc.nr = ops-first + i; + s-soc.clk = clk_get(dev-dev, NULL); + if (IS_ERR(s-soc.clk)) { + ret = PTR_ERR(s-soc.clk); + kfree(s); + return ret; + } soc_pcmcia_init_one(s-soc, ops, dev-dev); s-dev = dev; if (s-soc.nr) { @@ -220,6 +226,7 @@ static int pcmcia_remove(struct sa_dev *dev) for (; s; s = next) { next = s-next; soc_pcmcia_remove_one(s-soc); + clk_put(s-soc.clk); kfree(s); } -- 2.1.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH V2 4/6] pcmcia: soc-common: enable/disable socket clocks
Call clk_prepare_enable() during hw_init() and clk_disable_unprepare() during hw_shutdown() to ensure that the clock rates returned by clk_get_rate() are correct. It is safe to call enable/disable functions even on NULL clock, so this patch will not break cases when the socket clock is not set. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/soc_common.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index a2bc6ee..933f465 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -120,6 +120,8 @@ static void __soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt, if (skt-ops-hw_shutdown) skt-ops-hw_shutdown(skt); + + clk_disable_unprepare(skt-clk); } static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) @@ -131,6 +133,8 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret = 0, i; + clk_prepare_enable(skt-clk); + if (skt-ops-hw_init) { ret = skt-ops-hw_init(skt); if (ret) -- 2.1.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH RESEND 0/5] arm: sa1100: add cpu clock for fbdev and pcmcia
Dear Russell, 2014-11-06 10:41 GMT+03:00 Dmitry Eremin-Solenikov dbarysh...@gmail.com: These patches are required to make SL-5500 (collie) to work properly. Framebuffer maintainer added his ack to the respective patch. PCMCIA subsystem seems to be unmaintained at this moment. Russell, could you please review and hopefully ack these patches? On SA-1100 framebuffer and PCMCIA drivers make use of cpufreq_get(0) function call to determine the cpu frequency. Russell's commit 1937f5b91833e2e8e53bcc821fc7a5fbe6ccb9b5 (ARM: fix sa1100 build) fixed the build issues, but broke two devices (Collie and Jornada720). For those two boards the cpufreq code gets compiled but is not enabled (as board files do not provide timing information for the CPUFREQ driver). Thus cpufreq_get(0) returns incorrect value and incorrect timings get programmed into the hardware. PXA2xx (the very similar platform) uses Clock API to determine CPU frequency both in framebuffer and PCMCIA drivers. These patches make similar changes to StrongARM drivers. We can continue to carry over this patch set in local tree. Having a grave bug in upstream kernels. What is the purpose of upstream kernel then? Why did we have so many talks about bad practice of 'vendor/local/private' Linux trees? Do you see anything wrong with this patchset? Why do you keep on ignoring it? Did you stop caring about sa11x0? -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 0/5] arm: sa1100: add cpu clock for fbdev and pcmcia
These patches are required to make SL-5500 (collie) to work properly. Framebuffer maintainer added his ack to the respective patch. PCMCIA subsystem seems to be unmaintained at this moment. Russell, could you please review and hopefully ack these patches? On SA-1100 framebuffer and PCMCIA drivers make use of cpufreq_get(0) function call to determine the cpu frequency. Russell's commit 1937f5b91833e2e8e53bcc821fc7a5fbe6ccb9b5 (ARM: fix sa1100 build) fixed the build issues, but broke two devices (Collie and Jornada720). For those two boards the cpufreq code gets compiled but is not enabled (as board files do not provide timing information for the CPUFREQ driver). Thus cpufreq_get(0) returns incorrect value and incorrect timings get programmed into the hardware. PXA2xx (the very similar platform) uses Clock API to determine CPU frequency both in framebuffer and PCMCIA drivers. These patches make similar changes to StrongARM drivers. ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 4/5] pcmcia: sa1100: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa1100_generic.c | 1 + drivers/pcmcia/sa11xx_base.c| 14 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index ff8a027..d2ab060 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -93,6 +93,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) for (i = 0; i sinfo-nskt; i++) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(sinfo-clk); kfree(sinfo); return 0; } diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 54d3089..6dd94bb 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -135,14 +135,16 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, static int sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) { - return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); + unsigned long clk = clk_get_rate(skt-clk); + + return sa1100_pcmcia_set_mecr(skt, clk / 1000); } static int sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) { struct soc_pcmcia_timing timing; - unsigned int clock = cpufreq_get(0); + unsigned int clock = clk_get_rate(skt-clk); unsigned long mecr = MECR; char *p = buf; @@ -218,6 +220,11 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo; struct soc_pcmcia_socket *skt; int i, ret = 0; + struct clk *clk; + + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) + return -ENODEV; sa11xx_drv_pcmcia_ops(ops); @@ -226,12 +233,14 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, return -ENOMEM; sinfo-nskt = nr; + sinfo-clk = clk; /* Initialize processor specific parameters */ for (i = 0; i nr; i++) { skt = sinfo-skt[i]; skt-nr = first + i; + skt-clk = clk; soc_pcmcia_init_one(skt, ops, dev); ret = sa11xx_drv_pcmcia_add_one(skt); @@ -242,6 +251,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, if (ret) { while (--i = 0) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(clk); kfree(sinfo); } else { dev_set_drvdata(dev, sinfo); -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 5/5] pcmcia: sa1111: provide device clock
Both pxa2xx (long ago) and sa1100 (now) make use of clock device to get the cpu speed. Make sa glue code provide clock to platform layer. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..c5988be 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -145,6 +145,9 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, return -ENOMEM; s-soc.nr = ops-first + i; + s-soc.clk = clk_get(dev-dev, NULL); + if (IS_ERR(s-soc.clk)) + return -ENODEV; soc_pcmcia_init_one(s-soc, ops, dev-dev); s-dev = dev; if (s-soc.nr) { @@ -220,6 +223,7 @@ static int pcmcia_remove(struct sa_dev *dev) for (; s; s = next) { next = s-next; soc_pcmcia_remove_one(s-soc); + clk_put(s-soc.clk); kfree(s); } -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 2/5] arm: sa1100: add a clock alias for sa1111 pcmcia device
SA- uses internal MMIO space offsets as a device name, so device name for sa pcmcia is 1800 (PCMCIA is at offset 0x1800). Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 53f750d..03c75a8 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -124,6 +124,8 @@ static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa1100-rtc, NULL, NULL), CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), + /* sa names devices using internal offsets, PCMCIA is at 0x1800 */ + CLKDEV_INIT(1800, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 1/5] arm: sa1100: add cpu clock
Both SA1100 framebuffer and PCMCIA drivers require knowledge of cpu frequency to correctly program timings. Currently they receive timing information by calling cpufreq_get(0). However if cpu frequency driver is not enabled (e.g. due to unsupported DRAM chip/board on sa1110) cpufreq_get(0) returns 0, causing incorrect timings to be programmed. Add cpu clock returning cpu frequency, to be used by sa11x0 fb and pcmcia drivers. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 9fa6a99..53f750d 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -15,10 +15,12 @@ #include linux/clkdev.h #include mach/hardware.h +#include mach/generic.h struct clkops { void(*enable)(struct clk *); void(*disable)(struct clk *); + unsigned long (*get_rate)(struct clk *); }; struct clk { @@ -33,13 +35,6 @@ struct clk clk_##_name = { \ static DEFINE_SPINLOCK(clocks_lock); -/* Dummy clk routine to build generic kernel parts that may be using them */ -unsigned long clk_get_rate(struct clk *clk) -{ - return 0; -} -EXPORT_SYMBOL(clk_get_rate); - static void clk_gpio27_enable(struct clk *clk) { /* @@ -58,6 +53,19 @@ static void clk_gpio27_disable(struct clk *clk) GAFR = ~GPIO_32_768kHz; } +static void clk_cpu_enable(struct clk *clk) +{ +} + +static void clk_cpu_disable(struct clk *clk) +{ +} + +static unsigned long clk_cpu_get_rate(struct clk *clk) +{ + return sa11x0_getspeed(0) * 1000; +} + int clk_enable(struct clk *clk) { unsigned long flags; @@ -87,16 +95,35 @@ void clk_disable(struct clk *clk) } EXPORT_SYMBOL(clk_disable); +unsigned long clk_get_rate(struct clk *clk) +{ + if (clk clk-ops clk-ops-get_rate) + return clk-ops-get_rate(clk); + + return 0; +} +EXPORT_SYMBOL(clk_get_rate); + const struct clkops clk_gpio27_ops = { .enable = clk_gpio27_enable, .disable= clk_gpio27_disable, }; +const struct clkops clk_cpu_ops = { + .enable = clk_cpu_enable, + .disable= clk_cpu_disable, + .get_rate = clk_cpu_get_rate, +}; + static DEFINE_CLK(gpio27, clk_gpio27_ops); +static DEFINE_CLK(cpu, clk_cpu_ops); + static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa.0, NULL, clk_gpio27), CLKDEV_INIT(sa1100-rtc, NULL, NULL), + CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), + CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH RESEND 3/5] fbdev: sa1100fb: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com Acked-by: Tomi Valkeinen tomi.valkei...@ti.com --- drivers/video/fbdev/sa1100fb.c | 24 +--- drivers/video/fbdev/sa1100fb.h | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 580c444e..8933840 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -178,6 +178,7 @@ #include linux/dma-mapping.h #include linux/mutex.h #include linux/io.h +#include linux/clk.h #include video/sa1100fb.h @@ -413,9 +414,9 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var-transp.offset); #ifdef CONFIG_CPU_FREQ - dev_dbg(fbi-dev, dma period = %d ps, clock = %d kHz\n, + dev_dbg(fbi-dev, dma period = %d ps, clock = %ld kHz\n, sa1100fb_display_dma_period(var), - cpufreq_get(smp_processor_id())); + clk_get_rate(fbi-clk) / 1000); #endif return 0; @@ -586,9 +587,10 @@ static struct fb_ops sa1100fb_ops = { * Calculate the PCD value from the clock rate (in picoseconds). * We take account of the PPCR clock setting. */ -static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) +static inline unsigned int get_pcd(struct sa1100fb_info *fbi, + unsigned int pixclock) { - unsigned int pcd = cpuclock / 100; + unsigned int pcd = clk_get_rate(fbi-clk) / 100 / 1000; pcd *= pixclock; pcd /= 1000; @@ -667,7 +669,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ LCCR2_BegFrmDel(var-upper_margin) + LCCR2_EndFrmDel(var-lower_margin); - pcd = get_pcd(var-pixclock, cpufreq_get(0)); + pcd = get_pcd(fbi, var-pixclock); new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi-inf-lccr3 | (var-sync FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | (var-sync FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); @@ -1003,7 +1005,6 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); - struct cpufreq_freqs *f = data; u_int pcd; switch (val) { @@ -1012,7 +1013,7 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, break; case CPUFREQ_POSTCHANGE: - pcd = get_pcd(fbi-fb.var.pixclock, f-new); + pcd = get_pcd(fbi, fbi-fb.var.pixclock); fbi-reg_lccr3 = (fbi-reg_lccr3 ~0xff) | LCCR3_PixClkDiv(pcd); set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); break; @@ -1219,6 +1220,13 @@ static int sa1100fb_probe(struct platform_device *pdev) if (!fbi) goto failed; + fbi-clk = clk_get(pdev-dev, NULL); + if (IS_ERR(fbi-clk)) { + ret = PTR_ERR(fbi-clk); + fbi-clk = NULL; + goto failed; + } + fbi-base = ioremap(res-start, resource_size(res)); if (!fbi-base) goto failed; @@ -1271,6 +1279,8 @@ static int sa1100fb_probe(struct platform_device *pdev) failed: if (fbi) iounmap(fbi-base); + if (fbi-clk) + clk_put(fbi-clk); kfree(fbi); release_mem_region(res-start, resource_size(res)); return ret; diff --git a/drivers/video/fbdev/sa1100fb.h b/drivers/video/fbdev/sa1100fb.h index fc5d429..0139d13 100644 --- a/drivers/video/fbdev/sa1100fb.h +++ b/drivers/video/fbdev/sa1100fb.h @@ -68,6 +68,7 @@ struct sa1100fb_info { #endif const struct sa1100fb_mach_info *inf; + struct clk *clk; }; #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH 0/5] arm: sa1100: fix sa1100 fb and pcmcia w/o cpufreq
2014-10-24 13:37 GMT+03:00 Dmitry Eremin-Solenikov dbarysh...@gmail.com: Hello, These patches were sitting in my queue for some time. On SA-1100 framebuffer and PCMCIA drivers make use of cpufreq_get(0) function call to determine the cpu frequency. Russell's commit 1937f5b91833e2e8e53bcc821fc7a5fbe6ccb9b5 (ARM: fix sa1100 build) fixed the build issues, but broke two devices (Collie and Jornada720). For those two boards the cpufreq code gets compiled but is not enabled (as board files do not provide timing information for the CPUFREQ driver). Thus cpufreq_get(0) returns incorrect values and incorrect timings get programmed into the hardware. PXA2xx (the very similar platform) uses Clock API to determine CPU frequency both in framebuffer and PCMCIA drivers. These patches make similar changes to StrongARM drivers. These patches are required to make use of framebuffer and CF card on Sharp Collie (and possibly on HP Jornada 720). Russell, what about these patches? They are absolutely required for Collie to work properly. -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/5] arm: sa1100: add cpu clock
Both SA1100 framebuffer and PCMCIA drivers require knowledge of cpu frequency to correctly program timings. Currently they receive timing information by calling cpufreq_get(0). However if cpu frequency driver is not enabled (e.g. due to unsupported DRAM chip/board on sa1110) cpufreq_get(0) returns 0, causing incorrect timings to be programmed. Add cpu clock returning cpu frequency, to be used by sa11x0 fb and pcmcia drivers. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 9fa6a99..53f750d 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -15,10 +15,12 @@ #include linux/clkdev.h #include mach/hardware.h +#include mach/generic.h struct clkops { void(*enable)(struct clk *); void(*disable)(struct clk *); + unsigned long (*get_rate)(struct clk *); }; struct clk { @@ -33,13 +35,6 @@ struct clk clk_##_name = { \ static DEFINE_SPINLOCK(clocks_lock); -/* Dummy clk routine to build generic kernel parts that may be using them */ -unsigned long clk_get_rate(struct clk *clk) -{ - return 0; -} -EXPORT_SYMBOL(clk_get_rate); - static void clk_gpio27_enable(struct clk *clk) { /* @@ -58,6 +53,19 @@ static void clk_gpio27_disable(struct clk *clk) GAFR = ~GPIO_32_768kHz; } +static void clk_cpu_enable(struct clk *clk) +{ +} + +static void clk_cpu_disable(struct clk *clk) +{ +} + +static unsigned long clk_cpu_get_rate(struct clk *clk) +{ + return sa11x0_getspeed(0) * 1000; +} + int clk_enable(struct clk *clk) { unsigned long flags; @@ -87,16 +95,35 @@ void clk_disable(struct clk *clk) } EXPORT_SYMBOL(clk_disable); +unsigned long clk_get_rate(struct clk *clk) +{ + if (clk clk-ops clk-ops-get_rate) + return clk-ops-get_rate(clk); + + return 0; +} +EXPORT_SYMBOL(clk_get_rate); + const struct clkops clk_gpio27_ops = { .enable = clk_gpio27_enable, .disable= clk_gpio27_disable, }; +const struct clkops clk_cpu_ops = { + .enable = clk_cpu_enable, + .disable= clk_cpu_disable, + .get_rate = clk_cpu_get_rate, +}; + static DEFINE_CLK(gpio27, clk_gpio27_ops); +static DEFINE_CLK(cpu, clk_cpu_ops); + static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa.0, NULL, clk_gpio27), CLKDEV_INIT(sa1100-rtc, NULL, NULL), + CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), + CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 0/5] arm: sa1100: fix sa1100 fb and pcmcia w/o cpufreq
Hello, These patches were sitting in my queue for some time. On SA-1100 framebuffer and PCMCIA drivers make use of cpufreq_get(0) function call to determine the cpu frequency. Russell's commit 1937f5b91833e2e8e53bcc821fc7a5fbe6ccb9b5 (ARM: fix sa1100 build) fixed the build issues, but broke two devices (Collie and Jornada720). For those two boards the cpufreq code gets compiled but is not enabled (as board files do not provide timing information for the CPUFREQ driver). Thus cpufreq_get(0) returns incorrect values and incorrect timings get programmed into the hardware. PXA2xx (the very similar platform) uses Clock API to determine CPU frequency both in framebuffer and PCMCIA drivers. These patches make similar changes to StrongARM drivers. These patches are required to make use of framebuffer and CF card on Sharp Collie (and possibly on HP Jornada 720). -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 2/5] arm: sa1100: add a clock alias for sa1111 pcmcia device
SA- uses internal MMIO space offsets as a device name, so device name for sa pcmcia is 1800 (PCMCIA is at offset 0x1800). Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 53f750d..03c75a8 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -124,6 +124,8 @@ static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa1100-rtc, NULL, NULL), CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), + /* sa names devices using internal offsets, PCMCIA is at 0x1800 */ + CLKDEV_INIT(1800, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 5/5] pcmcia: sa1111: provide device clock
Both pxa2xx (long ago) and sa1100 (now) make use of clock device to get the cpu speed. Make sa glue code provide clock to platform layer. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..c5988be 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -145,6 +145,9 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, return -ENOMEM; s-soc.nr = ops-first + i; + s-soc.clk = clk_get(dev-dev, NULL); + if (IS_ERR(s-soc.clk)) + return -ENODEV; soc_pcmcia_init_one(s-soc, ops, dev-dev); s-dev = dev; if (s-soc.nr) { @@ -220,6 +223,7 @@ static int pcmcia_remove(struct sa_dev *dev) for (; s; s = next) { next = s-next; soc_pcmcia_remove_one(s-soc); + clk_put(s-soc.clk); kfree(s); } -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 3/5] fbdev: sa1100fb: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/video/fbdev/sa1100fb.c | 24 +--- drivers/video/fbdev/sa1100fb.h | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 580c444e..8933840 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -178,6 +178,7 @@ #include linux/dma-mapping.h #include linux/mutex.h #include linux/io.h +#include linux/clk.h #include video/sa1100fb.h @@ -413,9 +414,9 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var-transp.offset); #ifdef CONFIG_CPU_FREQ - dev_dbg(fbi-dev, dma period = %d ps, clock = %d kHz\n, + dev_dbg(fbi-dev, dma period = %d ps, clock = %ld kHz\n, sa1100fb_display_dma_period(var), - cpufreq_get(smp_processor_id())); + clk_get_rate(fbi-clk) / 1000); #endif return 0; @@ -586,9 +587,10 @@ static struct fb_ops sa1100fb_ops = { * Calculate the PCD value from the clock rate (in picoseconds). * We take account of the PPCR clock setting. */ -static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) +static inline unsigned int get_pcd(struct sa1100fb_info *fbi, + unsigned int pixclock) { - unsigned int pcd = cpuclock / 100; + unsigned int pcd = clk_get_rate(fbi-clk) / 100 / 1000; pcd *= pixclock; pcd /= 1000; @@ -667,7 +669,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ LCCR2_BegFrmDel(var-upper_margin) + LCCR2_EndFrmDel(var-lower_margin); - pcd = get_pcd(var-pixclock, cpufreq_get(0)); + pcd = get_pcd(fbi, var-pixclock); new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi-inf-lccr3 | (var-sync FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | (var-sync FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); @@ -1003,7 +1005,6 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); - struct cpufreq_freqs *f = data; u_int pcd; switch (val) { @@ -1012,7 +1013,7 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, break; case CPUFREQ_POSTCHANGE: - pcd = get_pcd(fbi-fb.var.pixclock, f-new); + pcd = get_pcd(fbi, fbi-fb.var.pixclock); fbi-reg_lccr3 = (fbi-reg_lccr3 ~0xff) | LCCR3_PixClkDiv(pcd); set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); break; @@ -1219,6 +1220,13 @@ static int sa1100fb_probe(struct platform_device *pdev) if (!fbi) goto failed; + fbi-clk = clk_get(pdev-dev, NULL); + if (IS_ERR(fbi-clk)) { + ret = PTR_ERR(fbi-clk); + fbi-clk = NULL; + goto failed; + } + fbi-base = ioremap(res-start, resource_size(res)); if (!fbi-base) goto failed; @@ -1271,6 +1279,8 @@ static int sa1100fb_probe(struct platform_device *pdev) failed: if (fbi) iounmap(fbi-base); + if (fbi-clk) + clk_put(fbi-clk); kfree(fbi); release_mem_region(res-start, resource_size(res)); return ret; diff --git a/drivers/video/fbdev/sa1100fb.h b/drivers/video/fbdev/sa1100fb.h index fc5d429..0139d13 100644 --- a/drivers/video/fbdev/sa1100fb.h +++ b/drivers/video/fbdev/sa1100fb.h @@ -68,6 +68,7 @@ struct sa1100fb_info { #endif const struct sa1100fb_mach_info *inf; + struct clk *clk; }; #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 4/5] pcmcia: sa1100: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa1100_generic.c | 1 + drivers/pcmcia/sa11xx_base.c| 14 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index ff8a027..d2ab060 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -93,6 +93,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) for (i = 0; i sinfo-nskt; i++) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(sinfo-clk); kfree(sinfo); return 0; } diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 54d3089..6dd94bb 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -135,14 +135,16 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, static int sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) { - return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); + unsigned long clk = clk_get_rate(skt-clk); + + return sa1100_pcmcia_set_mecr(skt, clk / 1000); } static int sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) { struct soc_pcmcia_timing timing; - unsigned int clock = cpufreq_get(0); + unsigned int clock = clk_get_rate(skt-clk); unsigned long mecr = MECR; char *p = buf; @@ -218,6 +220,11 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo; struct soc_pcmcia_socket *skt; int i, ret = 0; + struct clk *clk; + + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) + return -ENODEV; sa11xx_drv_pcmcia_ops(ops); @@ -226,12 +233,14 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, return -ENOMEM; sinfo-nskt = nr; + sinfo-clk = clk; /* Initialize processor specific parameters */ for (i = 0; i nr; i++) { skt = sinfo-skt[i]; skt-nr = first + i; + skt-clk = clk; soc_pcmcia_init_one(skt, ops, dev); ret = sa11xx_drv_pcmcia_add_one(skt); @@ -242,6 +251,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, if (ret) { while (--i = 0) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(clk); kfree(sinfo); } else { dev_set_drvdata(dev, sinfo); -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 2/2] pcmcia: sa1111: pass sa1111_dev to jornada720 code
All other sa platforms pass sa_dev instance to platform-specific code. Follow this approach for Jornada720 platform code. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c| 2 +- drivers/pcmcia/sa_generic.h| 2 +- drivers/pcmcia/sa_jornada720.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index a353186..53299f8 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -200,7 +200,7 @@ static int pcmcia_probe(struct sa_dev *dev) pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 - pcmcia_jornada720_init(dev-dev); + pcmcia_jornada720_init(dev); #endif #ifdef CONFIG_ARCH_LUBBOCK pcmcia_lubbock_init(dev); diff --git a/drivers/pcmcia/sa_generic.h b/drivers/pcmcia/sa_generic.h index 86b9cc8..e74ecfd 100644 --- a/drivers/pcmcia/sa_generic.h +++ b/drivers/pcmcia/sa_generic.h @@ -19,7 +19,7 @@ extern void sa_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia extern int sa_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); extern int pcmcia_badge4_init(struct sa_dev *); -extern int pcmcia_jornada720_init(struct device *); +extern int pcmcia_jornada720_init(struct sa_dev *); extern int pcmcia_lubbock_init(struct sa_dev *); extern int pcmcia_neponset_init(struct sa_dev *); diff --git a/drivers/pcmcia/sa_jornada720.c b/drivers/pcmcia/sa_jornada720.c index 40e0403..c2c3058 100644 --- a/drivers/pcmcia/sa_jornada720.c +++ b/drivers/pcmcia/sa_jornada720.c @@ -92,10 +92,9 @@ static struct pcmcia_low_level jornada720_pcmcia_ops = { .nr = 2, }; -int pcmcia_jornada720_init(struct device *dev) +int pcmcia_jornada720_init(struct sa_dev *sadev) { int ret = -ENODEV; - struct sa_dev *sadev = SA_DEV(dev); if (machine_is_jornada720()) { unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/2] pcmcia: sa1111: pass sa1111_dev to badge4-specific code
Pass sa_dev to platform-specific init code, as it is done by lubbock and neponset. This removes a compilation warnings: drivers/pcmcia/sa_badge4.c: In function 'pcmcia_badge4_init': drivers/pcmcia/sa_badge4.c:147:5: warning: passing argument 1 of 'sa_pcmcia_add' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_badge4.c:26:0: drivers/pcmcia/sa_generic.h:15:5: note: expected 'struct sa_dev *' but argument is of type 'struct device *' Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_badge4.c | 2 +- drivers/pcmcia/sa_generic.c | 2 +- drivers/pcmcia/sa_generic.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pcmcia/sa_badge4.c b/drivers/pcmcia/sa_badge4.c index 4d206f4..12f0dd0 100644 --- a/drivers/pcmcia/sa_badge4.c +++ b/drivers/pcmcia/sa_badge4.c @@ -132,7 +132,7 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { .nr = 2, }; -int pcmcia_badge4_init(struct device *dev) +int pcmcia_badge4_init(struct sa_dev *dev) { int ret = -ENODEV; diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..a353186 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -197,7 +197,7 @@ static int pcmcia_probe(struct sa_dev *dev) sa_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); #ifdef CONFIG_SA1100_BADGE4 - pcmcia_badge4_init(dev-dev); + pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 pcmcia_jornada720_init(dev-dev); diff --git a/drivers/pcmcia/sa_generic.h b/drivers/pcmcia/sa_generic.h index f6376e3..86b9cc8 100644 --- a/drivers/pcmcia/sa_generic.h +++ b/drivers/pcmcia/sa_generic.h @@ -18,7 +18,7 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, extern void sa_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *); extern int sa_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); -extern int pcmcia_badge4_init(struct device *); +extern int pcmcia_badge4_init(struct sa_dev *); extern int pcmcia_jornada720_init(struct device *); extern int pcmcia_lubbock_init(struct sa_dev *); extern int pcmcia_neponset_init(struct sa_dev *); -- 2.1.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH 0/2] pcmcia: small fixes for sa1111 machine code
Hello again, On Thu, Nov 28, 2013 at 5:03 PM, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: Hello, On Thu, Nov 21, 2013 at 2:48 AM, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: Dmitry Eremin-Solenikov (2): pcmcia: sa: pass sa_dev to badge4-specific code pcmcia: sa: pass sa_dev to jornada720-specific code drivers/pcmcia/sa_badge4.c | 2 +- drivers/pcmcia/sa_generic.c| 4 ++-- drivers/pcmcia/sa_generic.h| 4 ++-- drivers/pcmcia/sa_jornada720.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) These changes do not cause any functional change, are rather trivial and fix few compiler warnings. Can we get them in? Re-ping. These two patches are trivial, provide no functional changes, fix few warnings. Russell, would it be OK to merge them through your tree/patch-tracker? Should they be merged through some other tree (if so, can you please bless them?) -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/2] pcmcia: sa1111: pass sa1111_dev to badge4-specific code
Pass sa_dev to platform-specific init code, as it is done by lubbock and neponset. This removes a compilation warnings: drivers/pcmcia/sa_badge4.c: In function 'pcmcia_badge4_init': drivers/pcmcia/sa_badge4.c:147:5: warning: passing argument 1 of 'sa_pcmcia_add' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_badge4.c:26:0: drivers/pcmcia/sa_generic.h:15:5: note: expected 'struct sa_dev *' but argument is of type 'struct device *' Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_badge4.c | 2 +- drivers/pcmcia/sa_generic.c | 2 +- drivers/pcmcia/sa_generic.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pcmcia/sa_badge4.c b/drivers/pcmcia/sa_badge4.c index 4d206f4..12f0dd0 100644 --- a/drivers/pcmcia/sa_badge4.c +++ b/drivers/pcmcia/sa_badge4.c @@ -132,7 +132,7 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { .nr = 2, }; -int pcmcia_badge4_init(struct device *dev) +int pcmcia_badge4_init(struct sa_dev *dev) { int ret = -ENODEV; diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..a353186 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -197,7 +197,7 @@ static int pcmcia_probe(struct sa_dev *dev) sa_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); #ifdef CONFIG_SA1100_BADGE4 - pcmcia_badge4_init(dev-dev); + pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 pcmcia_jornada720_init(dev-dev); diff --git a/drivers/pcmcia/sa_generic.h b/drivers/pcmcia/sa_generic.h index f6376e3..86b9cc8 100644 --- a/drivers/pcmcia/sa_generic.h +++ b/drivers/pcmcia/sa_generic.h @@ -18,7 +18,7 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, extern void sa_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *); extern int sa_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); -extern int pcmcia_badge4_init(struct device *); +extern int pcmcia_badge4_init(struct sa_dev *); extern int pcmcia_jornada720_init(struct device *); extern int pcmcia_lubbock_init(struct sa_dev *); extern int pcmcia_neponset_init(struct sa_dev *); -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 2/2] pcmcia: sa1111: pass sa1111_dev to jornada720-specific code
Pass sa_dev to platform-specific init code, as it is done by lubbock and neponset. This removes a compilation warnings: drivers/pcmcia/sa_jornada720.c: In function 'pcmcia_jornada720_init': drivers/pcmcia/sa_jornada720.c:105:3: warning: passing argument 1 of 'sa_set_io_dir' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_jornada720.c:15:0: arch/arm/include/asm/hardware/sa.h:463:6: note: expected 'struct sa_dev *' but argument is of type 'struct device *' drivers/pcmcia/sa_jornada720.c:106:3: warning: passing argument 1 of 'sa_set_io' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_jornada720.c:15:0: arch/arm/include/asm/hardware/sa.h:464:6: note: expected 'struct sa_dev *' but argument is of type 'struct device *' drivers/pcmcia/sa_jornada720.c:107:3: warning: passing argument 1 of 'sa_set_sleep_io' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_jornada720.c:15:0: arch/arm/include/asm/hardware/sa.h:465:6: note: expected 'struct sa_dev *' but argument is of type 'struct device *' drivers/pcmcia/sa_jornada720.c:111:5: warning: passing argument 1 of 'sa_pcmcia_add' from incompatible pointer type [enabled by default] In file included from drivers/pcmcia/sa_jornada720.c:18:0: drivers/pcmcia/sa_generic.h:15:5: note: expected 'struct sa_dev *' but argument is of type 'struct device *' Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c| 2 +- drivers/pcmcia/sa_generic.h| 2 +- drivers/pcmcia/sa_jornada720.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index a353186..53299f8 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -200,7 +200,7 @@ static int pcmcia_probe(struct sa_dev *dev) pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 - pcmcia_jornada720_init(dev-dev); + pcmcia_jornada720_init(dev); #endif #ifdef CONFIG_ARCH_LUBBOCK pcmcia_lubbock_init(dev); diff --git a/drivers/pcmcia/sa_generic.h b/drivers/pcmcia/sa_generic.h index 86b9cc8..e74ecfd 100644 --- a/drivers/pcmcia/sa_generic.h +++ b/drivers/pcmcia/sa_generic.h @@ -19,7 +19,7 @@ extern void sa_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia extern int sa_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); extern int pcmcia_badge4_init(struct sa_dev *); -extern int pcmcia_jornada720_init(struct device *); +extern int pcmcia_jornada720_init(struct sa_dev *); extern int pcmcia_lubbock_init(struct sa_dev *); extern int pcmcia_neponset_init(struct sa_dev *); diff --git a/drivers/pcmcia/sa_jornada720.c b/drivers/pcmcia/sa_jornada720.c index 3baa3ef..ac60cd7 100644 --- a/drivers/pcmcia/sa_jornada720.c +++ b/drivers/pcmcia/sa_jornada720.c @@ -9,6 +9,7 @@ #include linux/device.h #include linux/errno.h #include linux/init.h +#include linux/io.h #include mach/hardware.h #include asm/hardware/sa.h @@ -91,7 +92,7 @@ static struct pcmcia_low_level jornada720_pcmcia_ops = { .nr = 2, }; -int pcmcia_jornada720_init(struct device *dev) +int pcmcia_jornada720_init(struct sa_dev *dev) { int ret = -ENODEV; -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 0/2] pcmcia: small fixes for sa1111 machine code
The following changes since commit dec8e46178bad9f1717a948572d76e0f804be801: Merge tag 'arc-v3.13-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc (2013-11-19 11:44:15 -0800) are available in the git repository at: git://github.com/lumag/linux sa-pcmcia for you to fetch changes up to d968c6bc2fad65739e546e4adf6b72ec1f4748e7: pcmcia: sa: pass sa_dev to jornada720-specific code (2013-11-21 01:27:24 +0400) Dmitry Eremin-Solenikov (2): pcmcia: sa: pass sa_dev to badge4-specific code pcmcia: sa: pass sa_dev to jornada720-specific code drivers/pcmcia/sa_badge4.c | 2 +- drivers/pcmcia/sa_generic.c| 4 ++-- drivers/pcmcia/sa_generic.h| 4 ++-- drivers/pcmcia/sa_jornada720.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 2/5] fbdev: sa1100fb: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/video/sa1100fb.c | 24 +--- drivers/video/sa1100fb.h | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index de76da0..05d1b37 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -178,6 +178,7 @@ #include linux/dma-mapping.h #include linux/mutex.h #include linux/io.h +#include linux/clk.h #include video/sa1100fb.h @@ -413,9 +414,9 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var-transp.offset); #ifdef CONFIG_CPU_FREQ - dev_dbg(fbi-dev, dma period = %d ps, clock = %d kHz\n, + dev_dbg(fbi-dev, dma period = %d ps, clock = %ld kHz\n, sa1100fb_display_dma_period(var), - cpufreq_get(smp_processor_id())); + clk_get_rate(fbi-clk) / 1000); #endif return 0; @@ -586,9 +587,10 @@ static struct fb_ops sa1100fb_ops = { * Calculate the PCD value from the clock rate (in picoseconds). * We take account of the PPCR clock setting. */ -static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) +static inline unsigned int get_pcd(struct sa1100fb_info *fbi, + unsigned int pixclock) { - unsigned int pcd = cpuclock / 100; + unsigned int pcd = clk_get_rate(fbi-clk) / 100 / 1000; pcd *= pixclock; pcd /= 1000; @@ -667,7 +669,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_ LCCR2_BegFrmDel(var-upper_margin) + LCCR2_EndFrmDel(var-lower_margin); - pcd = get_pcd(var-pixclock, cpufreq_get(0)); + pcd = get_pcd(fbi, var-pixclock); new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi-inf-lccr3 | (var-sync FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | (var-sync FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); @@ -1003,7 +1005,6 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); - struct cpufreq_freqs *f = data; u_int pcd; switch (val) { @@ -1012,7 +1013,7 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val, break; case CPUFREQ_POSTCHANGE: - pcd = get_pcd(fbi-fb.var.pixclock, f-new); + pcd = get_pcd(fbi, fbi-fb.var.pixclock); fbi-reg_lccr3 = (fbi-reg_lccr3 ~0xff) | LCCR3_PixClkDiv(pcd); set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); break; @@ -1219,6 +1220,13 @@ static int sa1100fb_probe(struct platform_device *pdev) if (!fbi) goto failed; + fbi-clk = clk_get(pdev-dev, NULL); + if (IS_ERR(fbi-clk)) { + ret = PTR_ERR(fbi-clk); + fbi-clk = NULL; + goto failed; + } + fbi-base = ioremap(res-start, resource_size(res)); if (!fbi-base) goto failed; @@ -1271,6 +1279,8 @@ static int sa1100fb_probe(struct platform_device *pdev) failed: if (fbi) iounmap(fbi-base); + if (fbi-clk) + clk_put(fbi-clk); kfree(fbi); release_mem_region(res-start, resource_size(res)); return ret; diff --git a/drivers/video/sa1100fb.h b/drivers/video/sa1100fb.h index fc5d429..0139d13 100644 --- a/drivers/video/sa1100fb.h +++ b/drivers/video/sa1100fb.h @@ -68,6 +68,7 @@ struct sa1100fb_info { #endif const struct sa1100fb_mach_info *inf; + struct clk *clk; }; #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 3/5] pcmcia: sa1100: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa1100_generic.c | 1 + drivers/pcmcia/sa11xx_base.c| 14 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index ff8a027..d2ab060 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -93,6 +93,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) for (i = 0; i sinfo-nskt; i++) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(sinfo-clk); kfree(sinfo); return 0; } diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 6eecd7c..aef0e69 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -38,6 +38,7 @@ #include linux/spinlock.h #include linux/io.h #include linux/slab.h +#include linux/clk.h #include mach/hardware.h #include asm/irq.h @@ -138,14 +139,15 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, static int sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) { - return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); + unsigned long clk = clk_get_rate(skt-clk); + return sa1100_pcmcia_set_mecr(skt, clk / 1000); } static int sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) { struct soc_pcmcia_timing timing; - unsigned int clock = cpufreq_get(0); + unsigned int clock = clk_get_rate(skt-clk); unsigned long mecr = MECR; char *p = buf; @@ -221,6 +223,11 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo; struct soc_pcmcia_socket *skt; int i, ret = 0; + struct clk *clk; + + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) + return -ENODEV; sa11xx_drv_pcmcia_ops(ops); @@ -229,12 +236,14 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, return -ENOMEM; sinfo-nskt = nr; + sinfo-clk = clk; /* Initialize processor specific parameters */ for (i = 0; i nr; i++) { skt = sinfo-skt[i]; skt-nr = first + i; + skt-clk = clk; soc_pcmcia_init_one(skt, ops, dev); ret = sa11xx_drv_pcmcia_add_one(skt); @@ -245,6 +254,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, if (ret) { while (--i = 0) soc_pcmcia_remove_one(sinfo-skt[i]); + clk_put(clk); kfree(sinfo); } else { dev_set_drvdata(dev, sinfo); -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 5/5] pcmcia: sa1111: make use of device clock
Use per-device clock (instead of calling cpufreq_get(0), which can return 0 if no cpu frequency driver is selected) to program timings. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/sa_generic.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index 65b02c3..c5988be 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -145,6 +145,9 @@ int sa_pcmcia_add(struct sa_dev *dev, struct pcmcia_low_level *ops, return -ENOMEM; s-soc.nr = ops-first + i; + s-soc.clk = clk_get(dev-dev, NULL); + if (IS_ERR(s-soc.clk)) + return -ENODEV; soc_pcmcia_init_one(s-soc, ops, dev-dev); s-dev = dev; if (s-soc.nr) { @@ -220,6 +223,7 @@ static int pcmcia_remove(struct sa_dev *dev) for (; s; s = next) { next = s-next; soc_pcmcia_remove_one(s-soc); + clk_put(s-soc.clk); kfree(s); } -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 4/5] arm: sa1100: add a clock alias for sa1111 pcmcia device
Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index abf1dc1..cd4762d 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -124,6 +124,7 @@ static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa1100-rtc, NULL, NULL), CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), + CLKDEV_INIT(1600, NULL, clk_cpu), /* sa pcmcia */ }; static int __init sa11xx_clk_init(void) -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/5] arm: sa1100: add cpu clock
Both SA1100 framebuffer and PCMCIA drivers require knowledge of cpu frequency to correctly program timings. Currently they receive timing information by calling cpufreq_get(0). However if cpu frequency driver is not enabled (e.g. due to unsupported DRAM chip/board on sa1110) cpufreq_get(0) returns 0, causing incorrect timings to be programmed. Add cpu clock returning cpu frequency, to be used by sa11x0 fb and pcmcia drivers. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- arch/arm/mach-sa1100/clock.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 172ebd0..abf1dc1 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -15,10 +15,12 @@ #include linux/clkdev.h #include mach/hardware.h +#include mach/generic.h struct clkops { void(*enable)(struct clk *); void(*disable)(struct clk *); + unsigned long (*get_rate)(struct clk *); }; struct clk { @@ -51,6 +53,19 @@ static void clk_gpio27_disable(struct clk *clk) GAFR = ~GPIO_32_768kHz; } +static void clk_cpu_enable(struct clk *clk) +{ +} + +static void clk_cpu_disable(struct clk *clk) +{ +} + +static unsigned long clk_cpu_get_rate(struct clk *clk) +{ + return sa11x0_getspeed(0) * 1000; +} + int clk_enable(struct clk *clk) { unsigned long flags; @@ -80,16 +95,35 @@ void clk_disable(struct clk *clk) } EXPORT_SYMBOL(clk_disable); +unsigned long clk_get_rate(struct clk *clk) +{ + if (clk clk-ops clk-ops-get_rate) + return clk-ops-get_rate(clk); + else + return 0; +} +EXPORT_SYMBOL(clk_get_rate); + const struct clkops clk_gpio27_ops = { .enable = clk_gpio27_enable, .disable= clk_gpio27_disable, }; +const struct clkops clk_cpu_ops = { + .enable = clk_cpu_enable, + .disable= clk_cpu_disable, + .get_rate = clk_cpu_get_rate, +}; + static DEFINE_CLK(gpio27, clk_gpio27_ops); +static DEFINE_CLK(cpu, clk_cpu_ops); + static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT(sa.0, NULL, clk_gpio27), CLKDEV_INIT(sa1100-rtc, NULL, NULL), + CLKDEV_INIT(sa11x0-fb, NULL, clk_cpu), + CLKDEV_INIT(sa11x0-pcmcia, NULL, clk_cpu), }; static int __init sa11xx_clk_init(void) -- 1.8.4.2 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH] pcmcia/pxa2xx_sharpsl: retain ops structure on collie
Hello, On 8/27/11, Pavel Machek pa...@ucw.cz wrote: On Fri 2011-08-19 10:19:33, Eric Miao wrote: On Thu, Aug 18, 2011 at 7:46 PM, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: On Sun, Aug 7, 2011 at 3:05 PM, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: The pxa2xx_sharpsl driver part is also used on collie, which (as a StrongARM board) has different expectations for PCMCIA drivers. So, on collie place sharpsl_pcmcia_ops in .data section rather than in __initdata. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com Cc: sta...@kernel.org Any comments on this patch? diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 69ae2fd..f2405dc 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -219,7 +219,11 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) sharpsl_pcmcia_init_reset(skt); } +#ifdef CONFIG_SA1100_COLLIE +static struct pcmcia_low_level sharpsl_pcmcia_ops = { +#else static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = { +#endif Looks OK, and maybe we can put it even simpler by just removing __initdata. I'd say so; ifdef to have initdata there is just too ugly. But I don't think it is stable material... Maybe... And memory lost on PXA will be minimal. It's stable material in the sense that lack of this patch causes kernel panics. -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH] pcmcia/pxa2xx_sharpsl: retain ops structure on collie
On Sun, Aug 7, 2011 at 3:05 PM, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: The pxa2xx_sharpsl driver part is also used on collie, which (as a StrongARM board) has different expectations for PCMCIA drivers. So, on collie place sharpsl_pcmcia_ops in .data section rather than in __initdata. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com Cc: sta...@kernel.org Any comments on this patch? diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 69ae2fd..f2405dc 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -219,7 +219,11 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) sharpsl_pcmcia_init_reset(skt); } +#ifdef CONFIG_SA1100_COLLIE +static struct pcmcia_low_level sharpsl_pcmcia_ops = { +#else static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = { +#endif .owner = THIS_MODULE, .hw_init = sharpsl_pcmcia_hw_init, .hw_shutdown = sharpsl_pcmcia_hw_shutdown, -- 1.7.2.5 -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH] pcmcia/pxa2xx_sharpsl: retain ops structure on collie
The pxa2xx_sharpsl driver part is also used on collie, which (as a StrongARM board) has different expectations for PCMCIA drivers. So, on collie place sharpsl_pcmcia_ops in .data section rather than in __initdata. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com Cc: sta...@kernel.org diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 69ae2fd..f2405dc 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -219,7 +219,11 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) sharpsl_pcmcia_init_reset(skt); } +#ifdef CONFIG_SA1100_COLLIE +static struct pcmcia_low_level sharpsl_pcmcia_ops = { +#else static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = { +#endif .owner = THIS_MODULE, .hw_init= sharpsl_pcmcia_hw_init, .hw_shutdown= sharpsl_pcmcia_hw_shutdown, -- 1.7.2.5 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 2/2] pcmcia: limit pxa2xx_trizeps4 subdriver to trizeps4 platform
pxa2xx_trizeps4 tries to register pxa2xx-pcmcia device not checking whether machine is really trizeps4, thus messing multi-machine kernels. Fix it up. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/pxa2xx_trizeps4.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_trizeps4.c b/drivers/pcmcia/pxa2xx_trizeps4.c index b7e5966..5bb4e1a 100644 --- a/drivers/pcmcia/pxa2xx_trizeps4.c +++ b/drivers/pcmcia/pxa2xx_trizeps4.c @@ -226,6 +226,9 @@ static int __init trizeps_pcmcia_init(void) { int ret; + if (!machine_is_trizeps4() !machine_is_trizeps4wl()) + return -ENODEV; + trizeps_pcmcia_device = platform_device_alloc(pxa2xx-pcmcia, -1); if (!trizeps_pcmcia_device) return -ENOMEM; -- 1.7.4.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH] colibri : don't register pxa2xx-pcmcia nodes on non-colibri platforms
PXA supports multi-machine kernels since long ago. However a kernel compiled with support for colibri and any other PXA machine and with PCMCIA enabled will barf at runtime about duplicate registration of pxa2xx-pcmcia device. Fix that. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- drivers/pcmcia/pxa2xx_colibri.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c index c3f7219..a520395 100644 --- a/drivers/pcmcia/pxa2xx_colibri.c +++ b/drivers/pcmcia/pxa2xx_colibri.c @@ -181,6 +181,9 @@ static int __init colibri_pcmcia_init(void) { int ret; + if (!machine_is_colibri() !machine_is_colibri320()) + return -ENODEV; + colibri_pcmcia_device = platform_device_alloc(pxa2xx-pcmcia, -1); if (!colibri_pcmcia_device) return -ENOMEM; -- 1.7.2.3 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/5] Import cistpl.h header from linux kernel
For mkcis and dump_cis programs we need a pcmcia/cistpl.h header from the linux kernel. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- mkcis/cistpl.h | 580 1 files changed, 580 insertions(+), 0 deletions(-) create mode 100644 mkcis/cistpl.h diff --git a/mkcis/cistpl.h b/mkcis/cistpl.h new file mode 100644 index 000..1c5088c --- /dev/null +++ b/mkcis/cistpl.h @@ -0,0 +1,580 @@ +/* + * cistpl.h + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * The initial developer of the original code is David A. Hinds + * dahi...@users.sourceforge.net. Portions created by David A. Hinds + * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + * + * (C) 1999 David A. Hinds + */ + +#ifndef _LINUX_CISTPL_H +#define _LINUX_CISTPL_H + +typedef unsigned char cisdata_t; + +#define CISTPL_NULL0x00 +#define CISTPL_DEVICE 0x01 +#define CISTPL_LONGLINK_CB 0x02 +#define CISTPL_INDIRECT0x03 +#define CISTPL_CONFIG_CB 0x04 +#define CISTPL_CFTABLE_ENTRY_CB0x05 +#define CISTPL_LONGLINK_MFC0x06 +#define CISTPL_BAR 0x07 +#define CISTPL_PWR_MGMNT 0x08 +#define CISTPL_EXTDEVICE 0x09 +#define CISTPL_CHECKSUM0x10 +#define CISTPL_LONGLINK_A 0x11 +#define CISTPL_LONGLINK_C 0x12 +#define CISTPL_LINKTARGET 0x13 +#define CISTPL_NO_LINK 0x14 +#define CISTPL_VERS_1 0x15 +#define CISTPL_ALTSTR 0x16 +#define CISTPL_DEVICE_A0x17 +#define CISTPL_JEDEC_C 0x18 +#define CISTPL_JEDEC_A 0x19 +#define CISTPL_CONFIG 0x1a +#define CISTPL_CFTABLE_ENTRY 0x1b +#define CISTPL_DEVICE_OC 0x1c +#define CISTPL_DEVICE_OA 0x1d +#define CISTPL_DEVICE_GEO 0x1e +#define CISTPL_DEVICE_GEO_A0x1f +#define CISTPL_MANFID 0x20 +#define CISTPL_FUNCID 0x21 +#define CISTPL_FUNCE 0x22 +#define CISTPL_SWIL0x23 +#define CISTPL_END 0xff +/* Layer 2 tuples */ +#define CISTPL_VERS_2 0x40 +#define CISTPL_FORMAT 0x41 +#define CISTPL_GEOMETRY0x42 +#define CISTPL_BYTEORDER 0x43 +#define CISTPL_DATE0x44 +#define CISTPL_BATTERY 0x45 +#define CISTPL_FORMAT_A0x47 +/* Layer 3 tuples */ +#define CISTPL_ORG 0x46 +#define CISTPL_SPCL0x90 + +typedef struct cistpl_longlink_t { +u_int addr; +} cistpl_longlink_t; + +typedef struct cistpl_checksum_t { +u_shortaddr; +u_shortlen; +u_char sum; +} cistpl_checksum_t; + +#define CISTPL_MAX_FUNCTIONS 8 +#define CISTPL_MFC_ATTR0x00 +#define CISTPL_MFC_COMMON 0x01 + +typedef struct cistpl_longlink_mfc_t { +u_char nfn; +struct { + u_char space; + u_int addr; +} fn[CISTPL_MAX_FUNCTIONS]; +} cistpl_longlink_mfc_t; + +#define CISTPL_MAX_ALTSTR_STRINGS 4 + +typedef struct cistpl_altstr_t { +u_char ns; +u_char ofs[CISTPL_MAX_ALTSTR_STRINGS]; +char str[254]; +} cistpl_altstr_t; + +#define CISTPL_DTYPE_NULL 0x00 +#define CISTPL_DTYPE_ROM 0x01 +#define CISTPL_DTYPE_OTPROM0x02 +#define CISTPL_DTYPE_EPROM 0x03 +#define CISTPL_DTYPE_EEPROM0x04 +#define CISTPL_DTYPE_FLASH 0x05 +#define CISTPL_DTYPE_SRAM 0x06 +#define CISTPL_DTYPE_DRAM 0x07 +#define CISTPL_DTYPE_FUNCSPEC 0x0d +#define CISTPL_DTYPE_EXTEND0x0e + +#define CISTPL_MAX_DEVICES 4 + +typedef struct cistpl_device_t { +u_char ndev; +struct { + u_char type; + u_char wp; + u_int speed; + u_int size; +} dev[CISTPL_MAX_DEVICES]; +} cistpl_device_t; + +#define CISTPL_DEVICE_MWAIT0x01 +#define CISTPL_DEVICE_3VCC 0x02 + +typedef struct cistpl_device_o_t { +u_char flags; +cistpl_device_tdevice; +} cistpl_device_o_t; + +#define CISTPL_VERS_1_MAX_PROD_STRINGS 4 + +typedef struct cistpl_vers_1_t { +u_char major; +u_char minor; +u_char ns; +u_char ofs[CISTPL_VERS_1_MAX_PROD_STRINGS]; +char str[254]; +} cistpl_vers_1_t; + +typedef struct cistpl_jedec_t { +u_char nid; +struct { + u_char mfr; + u_char info; +} id[CISTPL_MAX_DEVICES]; +} cistpl_jedec_t; + +typedef struct cistpl_manfid_t { +u_shortmanf; +u_shortcard; +} cistpl_manfid_t; + +#define CISTPL_FUNCID_MULTI0x00 +#define CISTPL_FUNCID_MEMORY 0x01 +#define CISTPL_FUNCID_SERIAL 0x02 +#define CISTPL_FUNCID_PARALLEL 0x03 +#define CISTPL_FUNCID_FIXED0x04 +#define CISTPL_FUNCID_VIDEO0x05 +#define CISTPL_FUNCID_NETWORK 0x06 +#define CISTPL_FUNCID_AIMS 0x07 +#define CISTPL_FUNCID_SCSI 0x08 + +#define CISTPL_SYSINIT_POST0x01 +#define
[PATCH 4/5] Add an utility to parse CIS files to readable form
Import from pcmcia-cs project a dump_cis utility. It reads machine-readable CIS file and output text representation (which can be processed by mkcis utility). Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- mkcis/dump_cis.c | 1992 ++ 1 files changed, 1992 insertions(+), 0 deletions(-) create mode 100644 mkcis/dump_cis.c diff --git a/mkcis/dump_cis.c b/mkcis/dump_cis.c new file mode 100644 index 000..4de8641 --- /dev/null +++ b/mkcis/dump_cis.c @@ -0,0 +1,1992 @@ +/*** + * PC Card CIS dump utility + * + * dump_cis.c from pcmcia-cs + * + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an AS + * IS basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The initial developer of the original code is David A. Hinds + * dahi...@users.sourceforge.net. Portions created by David A. Hinds + * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License version 2 (the GPL), in which + * case the provisions of the GPL are applicable instead of the + * above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use + * your version of this file under the MPL, indicate your decision + * by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + ***/ + +#include stdio.h +#include stdlib.h +#include string.h +#include endian.h + +#ifndef le16toh +# include byteswap.h +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define le16toh(x) (x) +# define le32toh(x) (x) +# else +# define le16toh(x) bswap_16(x) +# define le32toh(x) bswap_32(x) +# endif +#endif + +#include sys/types.h +#include unistd.h +#include fcntl.h + +#include cistpl.h + +/* Bits in IRQInfo1 field */ +#define IRQ_MASK 0x0f +#define IRQ_NMI_ID 0x01 +#define IRQ_IOCK_ID0x02 +#define IRQ_BERR_ID0x04 +#define IRQ_VEND_ID0x08 +#define IRQ_INFO2_VALID0x10 +#define IRQ_LEVEL_ID 0x20 +#define IRQ_PULSE_ID 0x40 +#define IRQ_SHARE_ID 0x80 + +typedef struct tuple_parse_t { + tuple_t tuple; + cisdata_t data[255]; + cisparse_t parse; +} tuple_parse_t; + +static int get_tuple_buf(int fd, tuple_t * tuple, int first); +static int parse_tuple(tuple_t * tuple, cisparse_t * parse); + +static int verbose; +static char indent[10] = ; + +/**/ + +static void print_tuple(tuple_parse_t * tup) +{ + int i; + printf(%soffset 0x%2.2x, tuple 0x%2.2x, link 0x%2.2x\n, + indent, tup-tuple.CISOffset, tup-tuple.TupleCode, + tup-tuple.TupleLink); + for (i = 0; i tup-tuple.TupleDataLen; i++) { + if ((i % 16) == 0) + printf(%s , indent); + printf(%2.2x , (u_char) tup-data[i]); + if ((i % 16) == 15) + putchar('\n'); + } + if ((i % 16) != 0) + putchar('\n'); +} + +/**/ + +static void print_funcid(cistpl_funcid_t * fn) +{ + printf(%sfuncid , indent); + switch (fn-func) { + case CISTPL_FUNCID_MULTI: + printf(multi_function); + break; + case CISTPL_FUNCID_MEMORY: + printf(memory_card); + break; + case CISTPL_FUNCID_SERIAL: + printf(serial_port); + break; + case CISTPL_FUNCID_PARALLEL: + printf(parallel_port); + break; + case CISTPL_FUNCID_FIXED: + printf(fixed_disk); + break; + case CISTPL_FUNCID_VIDEO: + printf(video_adapter); + break; + case CISTPL_FUNCID_NETWORK: + printf(network_adapter); + break; + case CISTPL_FUNCID_AIMS: + printf
[PATCH 1/5] Makefile.fwinst: include Makefile.lib
Include Makefile.lib into Makefile.fwinst to enable _shipped processing. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- scripts/Makefile.fwinst |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index 6bf8e87..fd34b74 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst @@ -16,6 +16,7 @@ include scripts/Kbuild.include include $(srctree)/$(obj)/Makefile include scripts/Makefile.host +include scripts/Makefile.lib mod-fw := $(fw-shipped-m) # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the -- 1.5.6.5 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 4/5] firmware: replace ihex files with text descriptions for CIS files
Now as we support generation of cis files from .ct, drop old ihex files and import new .ct from original pcmcia-cs project. This brings no actual changes in the binary firmware files. Signed-off-by: Dmitry Eremin-Solenikov dbarysh...@gmail.com --- firmware/cis/3CCFEM556.cis.ihex | 13 --- firmware/cis/3CCFEM556.ct| 22 +++ firmware/cis/3CXEM556.cis.ihex | 13 --- firmware/cis/3CXEM556.ct | 22 +++ firmware/cis/COMpad2.cis.ihex| 11 - firmware/cis/COMpad2.ct | 20 + firmware/cis/COMpad4.cis.ihex|9 --- firmware/cis/COMpad4.ct | 14 firmware/cis/DP83903.cis.ihex| 14 firmware/cis/DP83903.ct | 24 firmware/cis/E-CARD.ct |9 +++ firmware/cis/LA-PCM.cis.ihex | 20 - firmware/cis/LA-PCM.ct | 44 ++ firmware/cis/MT5634ZLX.cis.ihex | 11 - firmware/cis/MT5634ZLX.ct| 18 +++ firmware/cis/NE2K.cis.ihex |8 --- firmware/cis/NE2K.ct | 10 firmware/cis/PCMLM28.cis.ihex| 18 --- firmware/cis/PCMLM28.ct | 37 +++ firmware/cis/PE-200.cis.ihex |9 --- firmware/cis/PE-200.ct | 11 + firmware/cis/PE520.cis.ihex |9 --- firmware/cis/PE520.ct| 11 + firmware/cis/RS-COM-2P.cis.ihex | 10 firmware/cis/RS-COM-2P.ct| 14 firmware/cis/SW_555_SER.cis.ihex | 12 -- firmware/cis/SW_555_SER.ct | 19 firmware/cis/SW_7xx_SER.cis.ihex | 13 --- firmware/cis/SW_7xx_SER.ct | 21 ++ firmware/cis/SW_8xx_SER.cis.ihex | 13 --- firmware/cis/SW_8xx_SER.ct | 20 + firmware/cis/tamarack.cis.ihex | 10 firmware/cis/tamarack.ct | 17 ++ 33 files changed, 333 insertions(+), 193 deletions(-) delete mode 100644 firmware/cis/3CCFEM556.cis.ihex create mode 100644 firmware/cis/3CCFEM556.ct delete mode 100644 firmware/cis/3CXEM556.cis.ihex create mode 100644 firmware/cis/3CXEM556.ct delete mode 100644 firmware/cis/COMpad2.cis.ihex create mode 100644 firmware/cis/COMpad2.ct delete mode 100644 firmware/cis/COMpad4.cis.ihex create mode 100644 firmware/cis/COMpad4.ct delete mode 100644 firmware/cis/DP83903.cis.ihex create mode 100644 firmware/cis/DP83903.ct create mode 100644 firmware/cis/E-CARD.ct delete mode 100644 firmware/cis/LA-PCM.cis.ihex create mode 100644 firmware/cis/LA-PCM.ct delete mode 100644 firmware/cis/MT5634ZLX.cis.ihex create mode 100644 firmware/cis/MT5634ZLX.ct delete mode 100644 firmware/cis/NE2K.cis.ihex create mode 100644 firmware/cis/NE2K.ct delete mode 100644 firmware/cis/PCMLM28.cis.ihex create mode 100644 firmware/cis/PCMLM28.ct delete mode 100644 firmware/cis/PE-200.cis.ihex create mode 100644 firmware/cis/PE-200.ct delete mode 100644 firmware/cis/PE520.cis.ihex create mode 100644 firmware/cis/PE520.ct delete mode 100644 firmware/cis/RS-COM-2P.cis.ihex create mode 100644 firmware/cis/RS-COM-2P.ct delete mode 100644 firmware/cis/SW_555_SER.cis.ihex create mode 100644 firmware/cis/SW_555_SER.ct delete mode 100644 firmware/cis/SW_7xx_SER.cis.ihex create mode 100644 firmware/cis/SW_7xx_SER.ct delete mode 100644 firmware/cis/SW_8xx_SER.cis.ihex create mode 100644 firmware/cis/SW_8xx_SER.ct delete mode 100644 firmware/cis/tamarack.cis.ihex create mode 100644 firmware/cis/tamarack.ct diff --git a/firmware/cis/3CCFEM556.cis.ihex b/firmware/cis/3CCFEM556.cis.ihex deleted file mode 100644 index e4d92b1..000 --- a/firmware/cis/3CCFEM556.cis.ihex +++ /dev/null @@ -1,13 +0,0 @@ -:1103FF152D050033436F6D004D65A2 -:100010006761686572747A2033434346454D3535D0 -:1000200036004C414E202B2035366B204D6F6465D9 -:100030006DFF2004010156052102060B9F -:100042004D6B00FF001303439E -:100050004953210206001A060507001067021B0912 -:1000600087011901556430FF00130343495313 -:10007000210202001A060527001177021B09A701B9 -:090080001901552330FF00B8 -:0001FF -# -# This card is MFC-compliant, but identifies itself as single function -# diff --git a/firmware/cis/3CCFEM556.ct b/firmware/cis/3CCFEM556.ct new file mode 100644 index 000..be627d0 --- /dev/null +++ b/firmware/cis/3CCFEM556.ct @@ -0,0 +1,22 @@ +# +# This card is MFC-compliant, but identifies itself as single function +# +vers_1 5.0, 3Com, Megahertz 3CCFEM556, LAN + 56k Modem +manfid 0x0101, 0x0556 +funcid 0 + +mfc { + funcid network_adapter + config base 0x1000 mask 0x267 last_index 0x07 + cftable_entry 0x07 +Vcc Vnom 5V +irq mask 0x [level] +io 0x-0x000f [8bit] [16bit] +}, { + funcid serial_port + config base 0x1100 mask 0x277 last_index 0x27
Re: [PATCH 2/5] Add mkcis - a program that can create .cis from text description
On Thu, Sep 23, 2010 at 7:29 PM, David Woodhouse dw...@infradead.org wrote: On Thu, 2010-09-23 at 19:19 +0400, Dmitry Eremin-Solenikov wrote: For CIS files (describing hardware on PCMCIA and some other busses) binary file isn't the 'preferred for for modification' in most cases. pcmcia-cs project have developed pack_cis program which can be used (and was used most probably) to generate .cis files from simple text descriptions. Import this code to the kernel under the name of mkcis. This is useful, thanks -- but NACK. The firmware/ directory of the kernel will hopefully die soon, and is no longer what's actually shipped by many distributions. We should be concentrating on the linux-firmware.git repository instead. Should I redo this patch serie against linux-firmware.git (probably with just putting .ct files near .cis)? -- David Woodhouse Open Source Technology Centre david.woodho...@intel.com Intel Corporation -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH] pcmcia: pxa2xx-sharpsl: check if we do have Scoop config
Check if we really have Scoop config, otherwice we can get a nice Oops during probe. --- drivers/pcmcia/pxa2xx_sharpsl.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 1cd02f5..bc43f78 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -255,6 +255,9 @@ static int __init sharpsl_pcmcia_init(void) { int ret; + if (!platform_scoop_config) + return -ENODEV; + sharpsl_pcmcia_ops.nr = platform_scoop_config-num_devs; sharpsl_pcmcia_device = platform_device_alloc(pxa2xx-pcmcia, -1); -- 1.6.2.1 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH] pcmcia: pxa2xx-sharpsl: check if we do have Scoop config
2009/4/20 Russell King - ARM Linux li...@arm.linux.org.uk: On Mon, Apr 20, 2009 at 08:01:19PM +0400, Dmitry Eremin-Solenikov wrote: Check if we really have Scoop config, otherwice we can get a nice Oops during probe. Looks to me like -rc material. Please submit to the patch tracker with your (missing) sign-off. Thanks. Done, thanks. --- drivers/pcmcia/pxa2xx_sharpsl.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 1cd02f5..bc43f78 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -255,6 +255,9 @@ static int __init sharpsl_pcmcia_init(void) { int ret; + if (!platform_scoop_config) + return -ENODEV; + sharpsl_pcmcia_ops.nr = platform_scoop_config-num_devs; sharpsl_pcmcia_device = platform_device_alloc(pxa2xx-pcmcia, -1); -- 1.6.2.1 --- List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php -- With best wishes Dmitry ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia