Re: [PATCH 1/3 v3] exynos: i2c: Fix i2c driver to handle NACKs properly
Hello Naveen, Am 15.10.2013 07:12, schrieb Naveen Krishna Chatradhi: The Exynos5 i2c driver does not handle NACKs properly. This change: - fixes the NACK processing problem (do not continue transaction if address cycle was NACKed) - eliminates a fair amount of duplicate code Signed-off-by: Vadim Bendeburyvben...@chromium.org Reviewed-by: Simon Glasss...@google.com Signed-off-by: Naveen Krishna Chatradhich.nav...@samsung.com --- Changes since v1: Fixed complilation warning in function i2c_init() Changes since v2: None drivers/i2c/s3c24x0_i2c.c | 214 +++-- 1 file changed, 90 insertions(+), 124 deletions(-) Hmm.. I think your patchset is for u-boot, or? But I could not find the u-boot ml on cc... instead some linux ml ... if so, please resend to the u-boot ml ... (matches for all three patches from you) bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
Hello Nori, On 08.08.2012 19:35, Sekhar Nori wrote: Hi Heiko, On 7/5/2012 6:20 PM, Heiko Schocher wrote: - AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocherh...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhousedw...@infradead.org Cc: Ben Dooksben-li...@fluff.org Cc: Wolfram Sangw.s...@pengutronix.de Cc: Sekhar Norinsek...@ti.com Cc: Kevin Hilmankhil...@ti.com Cc: Wolfgang Denkw...@denx.de Cc: Scott Woodscottw...@freescale.com Cc: Sylwester Nawrockis.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? - changes for v3: - add comments from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init now used for Interrupt controller init - changes for v4: add comment from Nori Sekhar: - rename davinci emac compatible property to ti,davinci-dm6467-emac - remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar - changes for v5: add comments from Grant Likely: - rename compatible prop to ti,cp-intc - changes for v6: rework this patch, as patch ARM: davinci: cp_intc: Add OF support for TI interrupt controller was changed from Nori Sekhar on Jul 03, 2012; 9:16pm Changes therefore in this patch: Call of_irq_init() in the generic DT board file and not in the interrupt controller code. See arch/arm/mach-at91/board-dt.c or arch/arm/mach-omap2/board-generic.c for examples. At this point the question raises, if we should rename this board port from arch/arm/mach-davinci/enbw_cmc.c to arch/arm/mach-davinci/board-dt.c ? Also the defconfig to davinci_of_defconfig ... ? The USB and MMC callbacks are currently board specific, but if other boards come in, that could be easily adapted for their needs ... arch/arm/boot/dts/enbw_cmc.dts | 183 +++ arch/arm/configs/enbw_cmc_defconfig | 126 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 385 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 705 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c With the move to DT, we are not going to add more board specific files and defconfigs. I am working on adding a generic dt board file for DA850 (similar to what has been done for imx). That file is not going to do any platform device registrations. If you are OK with it, I will add the dts file for enbw_cmc board in the patch series I am planning to post. I am fine with that. If you have a working version, you can sent it (if you want) to me, so I can test it on the enbw_cmc board. Things like USB and MMC/SD will need to be converted to DT before they can be supported on new boards. Ok, understood. bye
Re: [PATCH v7] ARM: davinci: i2c: add OF support
Hello, On 30.07.2012 09:21, Heiko Schocher wrote: add of support for the davinci i2c driver. Signed-off-by: Heiko Schocherh...@denx.de Signed-off-by: Sekhar Norinsek...@ti.com Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooksben-li...@fluff.org Cc: Wolfram Sangw.s...@pengutronix.de Cc: Grant Likelygrant.lik...@secretlab.ca Cc: Sekhar Norinsek...@ti.com Cc: Wolfgang Denkw...@denx.de Cc: Sylwester Nawrockis.nawro...@samsung.com --- - changes for v2: - add comments from Sylwester Nawrockis.nawro...@samsung.com: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - no changes for v3 - changes for v4 remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar - changes for v5 add comments from Grant Likely: - do not change value of dev-dev-platform_data, instead hold a copy in davinci_i2c_dev. - changes for v6: add comments from Sekhar Nori: - removed unneccessary include - merge patch from Sekhar Nori: setup the newly introduced dev-pdata member correctly once in probe - i2c_get_plattformdata(() not needed, remove a lot of checks for pdata in code - add Signed-off-by: Sekhar Norinsek...@ti.com - patch no longer in patchserie, as it has no dependencies. - changes for v7: add comments from Wolfram Sang: - move Documentation/devicetree/bindings/arm/davinci/i2c.txt to Documentation/devicetree/bindings/i2c/davinci.txt - remove bus-delay property Documentation/devicetree/bindings/i2c/davinci.txt | 28 drivers/i2c/busses/i2c-davinci.c | 48 - 2 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/i2c/davinci.txt ping ... any comments? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v7] ARM: davinci: i2c: add OF support
Hello Shubhrajyoti, On 30.07.2012 10:42, Shubhrajyoti Datta wrote: On Mon, Jul 30, 2012 at 12:51 PM, Heiko Schocherh...@denx.de wrote: add of support for the davinci i2c driver. [...] diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 79b4bcb..b6185dc 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c [...] @@ -635,6 +633,12 @@ static struct i2c_algorithm i2c_davinci_algo = { .functionality = i2c_davinci_func, }; +static const struct of_device_id davinci_i2c_of_match[] = { + {.compatible = ti,davinci-i2c, }, + {}, +}; +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); + Should this be protected under OF flag? No, as I know, this is not needed. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6] ARM: davinci: i2c: add OF support
add of support for the davinci i2c driver. Signed-off-by: Heiko Schocher h...@denx.de Signed-off-by: Sekhar Nori nsek...@ti.com Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Grant Likely grant.lik...@secretlab.ca Cc: Sekhar Nori nsek...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - changes for v2: - add comments from Sylwester Nawrocki s.nawro...@samsung.com: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - no changes for v3 - changes for v4 remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar - changes for v5 add comments from Grant Likely: - do not change value of dev-dev-platform_data, instead hold a copy in davinci_i2c_dev. - changes for v6: add comments from Sekhar Nori: - removed unneccessary include - merge patch from Sekhar Nori: setup the newly introduced dev-pdata member correctly once in probe - i2c_get_plattformdata(() not needed, remove a lot of checks for pdata in code - add Signed-off-by: Sekhar Nori nsek...@ti.com - patch no longer in patchserie, as it has no dependencies. --- .../devicetree/bindings/arm/davinci/i2c.txt| 31 drivers/i2c/busses/i2c-davinci.c | 50 +++ 2 files changed, 70 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..e98a025 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt @@ -0,0 +1,31 @@ +* Texas Instruments Davinci I2C + +This file provides information, what the device node for the +davinci i2c interface contain. + +Required properties: +- compatible: ti,davinci-i2c; +- reg : Offset and length of the register set for the device + +Recommended properties : +- interrupts : a standard interrupt property. +- clock-frequency : desired I2C bus clock frequency in Hz. + +Optional properties: +- bus-delay: bus delay in usec + +Example (enbw_cmc board): + i2c@1c22000 { + compatible = ti,davinci-i2c; + reg = 0x22000 0x1000; + clock-frequency = 10; + interrupts = 15; + interrupt-parent = intc; + #address-cells = 1; + #size-cells = 0; + + dtt@48 { + compatible = national,lm75; + reg = 0x48; + }; + }; diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..8d4efce 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,6 +38,8 @@ #include linux/slab.h #include linux/cpufreq.h #include linux/gpio.h +#include linux/of_i2c.h +#include linux/of_device.h #include mach/hardware.h #include mach/i2c.h @@ -114,6 +116,7 @@ struct davinci_i2c_dev { struct completion xfr_complete; struct notifier_block freq_transition; #endif + struct davinci_i2c_platform_data *pdata; }; /* default platform data to use if not supplied in the platform_device */ @@ -155,7 +158,7 @@ static void generic_i2c_clock_pulse(unsigned int scl_pin) static void i2c_recover_bus(struct davinci_i2c_dev *dev) { u32 flag = 0; - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = dev-pdata; dev_err(dev-dev, initiating i2c bus recovery\n); /* Send NACK to the slave */ @@ -163,8 +166,7 @@ static void i2c_recover_bus(struct davinci_i2c_dev *dev) flag |= DAVINCI_I2C_MDR_NACK; /* write the data into mode register */ davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); - if (pdata) - generic_i2c_clock_pulse(pdata-scl_pin); + generic_i2c_clock_pulse(pdata-scl_pin); /* Send STOP */ flag = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG); flag |= DAVINCI_I2C_MDR_STP; @@ -187,7 +189,7 @@ static inline void davinci_i2c_reset_ctrl(struct davinci_i2c_dev *i2c_dev, static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev) { - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = dev-pdata; u16 psc; u32 clk; u32 d; @@ -235,10 +237,7 @@ static
Re: [PATCH v5 5/7] ARM: davinci: i2c: add OF support
Hello Sekhar, On 13.07.2012 15:57, Sekhar Nori wrote: Hi Heiko, On 5/30/2012 3:49 PM, Heiko Schocher wrote: add of support for the davinci i2c driver. Signed-off-by: Heiko Schocherh...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooksben-li...@fluff.org Cc: Wolfram Sangw.s...@pengutronix.de Cc: Grant Likelygrant.lik...@secretlab.ca Cc: Sekhar Norinsek...@ti.com Cc: Wolfgang Denkw...@denx.de Cc: Sylwester Nawrockis.nawro...@samsung.com [...] diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..e98a025 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt [...] diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..4e7a966 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,9 +38,12 @@ #includelinux/slab.h #includelinux/cpufreq.h #includelinux/gpio.h +#includelinux/of_i2c.h +#includelinux/of_device.h #includemach/hardware.h #includemach/i2c.h +#includemach/mux.h Seems like a stray change. I was able to build and use just fine without this include. Hups. Good catch! Removed. /* - global defines --- */ @@ -114,6 +117,7 @@ struct davinci_i2c_dev { struct completion xfr_complete; struct notifier_block freq_transition; #endif + struct davinci_i2c_platform_data *pdata; }; /* default platform data to use if not supplied in the platform_device */ @@ -149,13 +153,22 @@ static void generic_i2c_clock_pulse(unsigned int scl_pin) } } +static struct davinci_i2c_platform_data + *i2c_get_plattformdata(struct davinci_i2c_dev *dev) +{ + if (dev-dev-platform_data == NULL) + return dev-pdata; + + return dev-dev-platform_data; +} It seems to me that if we setup the newly introduced dev-pdata member correctly once in probe, there should not be a need for this function. We can also eliminate multiple checks for pdata in code. See below for more. Ok. + /* This routine does i2c bus recovery as specified in the * i2c protocol Rev. 03 section 3.16 titled Bus clear */ static void i2c_recover_bus(struct davinci_i2c_dev *dev) { u32 flag = 0; - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = i2c_get_plattformdata(dev); dev_err(dev-dev, initiating i2c bus recovery\n); /* Send NACK to the slave */ @@ -187,7 +200,7 @@ static inline void davinci_i2c_reset_ctrl(struct davinci_i2c_dev *i2c_dev, static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev) { - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = i2c_get_plattformdata(dev); u16 psc; u32 clk; u32 d; @@ -235,7 +248,7 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev) */ static int i2c_davinci_init(struct davinci_i2c_dev *dev) { - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = i2c_get_plattformdata(dev); if (!pdata) pdata =davinci_i2c_platform_data_default; @@ -308,7 +321,7 @@ static int i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) { struct davinci_i2c_dev *dev = i2c_get_adapdata(adap); - struct davinci_i2c_platform_data *pdata = dev-dev-platform_data; + struct davinci_i2c_platform_data *pdata = i2c_get_plattformdata(dev); u32 flag; u16 w; int r; @@ -635,6 +648,12 @@ static struct i2c_algorithm i2c_davinci_algo = { .functionality = i2c_davinci_func, }; +static const struct of_device_id davinci_i2c_of_match[] = { + {.compatible = ti,davinci-i2c, }, + {}, +}; +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); + static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; @@ -676,6 +695,25 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev-irq = irq-start; platform_set_drvdata(pdev, dev); + if ((dev-dev-platform_data == NULL) + (pdev-dev.of_node)) { + u32 prop; + + dev-pdata = devm_kzalloc(pdev-dev, + sizeof(struct davinci_i2c_platform_data), GFP_KERNEL); + if (!dev-pdata) { + r = -ENOMEM; + goto err_free_mem; + } + memcpy(dev-pdata,davinci_i2c_platform_data_default, + sizeof(struct davinci_i2c_platform_data)); + if (!of_property_read_u32(pdev-dev.of_node, clock-frequency
[PATCH v6 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
- AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? - changes for v3: - add comments from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init now used for Interrupt controller init - changes for v4: add comment from Nori Sekhar: - rename davinci emac compatible property to ti,davinci-dm6467-emac - remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar - changes for v5: add comments from Grant Likely: - rename compatible prop to ti,cp-intc - changes for v6: rework this patch, as patch ARM: davinci: cp_intc: Add OF support for TI interrupt controller was changed from Nori Sekhar on Jul 03, 2012; 9:16pm Changes therefore in this patch: Call of_irq_init() in the generic DT board file and not in the interrupt controller code. See arch/arm/mach-at91/board-dt.c or arch/arm/mach-omap2/board-generic.c for examples. At this point the question raises, if we should rename this board port from arch/arm/mach-davinci/enbw_cmc.c to arch/arm/mach-davinci/board-dt.c ? Also the defconfig to davinci_of_defconfig ... ? The USB and MMC callbacks are currently board specific, but if other boards come in, that could be easily adapted for their needs ... arch/arm/boot/dts/enbw_cmc.dts | 183 +++ arch/arm/configs/enbw_cmc_defconfig | 126 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 385 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 705 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..32dc7a9 --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,183 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + model = EnBW CMC; + compatible = enbw,cmc; + + aliases { + ethernet0 = eth0; + }; + + arm
[PATCH v5 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
- AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? - changes for v3: - add comments from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init now used for Interrupt controller init - changes for v4: add comment from Nori Sekhar: - rename davinci emac compatible property to ti,davinci-dm6467-emac - remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar - changes for v5: add comments from Grant Likely: - rename compatible prop to ti,cp-intc arch/arm/boot/dts/enbw_cmc.dts | 172 +++ arch/arm/configs/enbw_cmc_defconfig | 123 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 374 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 680 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..19c7559 --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,172 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + model = EnBW CMC; + compatible = enbw,cmc; + + aliases { + ethernet0 = eth0; + }; + + arm { + #address-cells = 1; + #size-cells = 1; + ranges = 0 0xfffee000 0x0002; + intc: interrupt-controller@1 { + compatible = ti,cp-intc; + interrupt-controller; + #interrupt-cells = 1; + ti,intc-size = 101; + reg = 0x0 0x2000; + }; + }; + soc@1c0 { + compatible = ti,da850; + #address-cells = 1; + #size-cells = 1; + ranges = 0x0 0x01c0 0x40; + + serial0: serial@1c42000 { + compatible = ti,da850, ns16550a; + reg = 0x42000
[PATCH v4 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board
this patchserie add support for the davinci am1808 based enbw_cmc board. changes for v2: Post this patchserie now as v2, as reworked in the comments I got for the RFC serie. changes for v3: - Interrupt Controller: - comment from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init() is now also for the of case the name of the init function (it calls the new __cp_intc_init() function, which was the old cp_intc_init()). Through this rework the changes for OF is better visible. As the OF case uses the irq_domain rework from Grant Likely, maybe the none OF case can use this also, but this should be tested on a hw ... changes for v4: - Interrupt Controller: - split in two patches as Nori Sekhar suggested one for the irq_domain change one for DT support - add comment from Grant Likely for the DT part: remove if/else clause, not needed. Make use of DT runtime configurable The non OF case is not tested! Got no comments to the following points, I noted in the RFC series, so posting this patchseries with them: - ARM: davinci: configure davinci aemif chipselects through OF not moved to mfd, as mentioned in this discussion: http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-arm-davinci-configure-davinci-aemif-chipselects-through-OF-td7059739.html instead use a phandle in the DTS, so drivers which uses the davinci aemif, can call davinci_aemif_setup_timing_of() This is just thought as an RFC ... The enbw_cmc board support not really need to setup this bus timings, as they are setup in U-Boot ... but I want to post this, as I think, it is a nice to have, and I am not really sure, if this has to be a MFD device (If so, all bus interfaces for other SoCs should be converted also to MFD devices) ... as an example how this can be used I add this to the davinci nand controller OF support patch, in this patchserie. - ARM: davinci: mux: add OF support I want to get rid of the pin setup code in board code ... This patch introduces a davinci_cfg_reg_of() function, which davinci drivers can call, if they found a pinmux-handle, so used in the following drivers in this patchserie: drivers/net/ethernet/ti/davinci_emac drivers/i2c/busses/i2c-davinci.c drivers/mtd/nand/davinci_nand.c This is removed for v4 serie, as Nori Sekhar suggested. - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. change for v4: The 10 ms delay is no longer needed, see discussion here: http://www.spinics.net/lists/linux-usb/msg64232.html shows the way to go ... - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC board specific callbacks, how to solve this with OF support? Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sergei Shtylyov sshtyl...@mvista.com Cc: Grant Likely grant.lik...@secretlab.ca Heiko Schocher (7): ARM: davinci, intc: Add irq domain support ARM: davinci, intc: Add OF support for TI interrupt controller ARM: davinci: configure davinci aemif chipselects through OF ARM: davinci: net: davinci_emac: add OF support ARM: davinci: i2c: add OF support ARM: mtd: nand: davinci: add OF support for davinci nand controller ARM: davinci: add support for the am1808 based enbw_cmc board .../devicetree/bindings/arm/davinci/aemif.txt | 119 +++ .../devicetree/bindings/arm/davinci/i2c.txt| 31 ++ .../devicetree/bindings/arm/davinci/intc.txt | 27 ++ .../devicetree/bindings/arm/davinci/nand.txt | 72 .../devicetree/bindings/net/davinci_emac.txt | 41 +++ arch/arm/boot/dts/enbw_cmc.dts | 172 + arch/arm/configs/enbw_cmc_defconfig| 123 +++ arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/aemif.c | 86 +- arch/arm/mach-davinci/board-enbw-cmc.c | 374 arch/arm/mach-davinci/cp_intc.c| 74 - arch/arm/mach-davinci/include/mach/aemif.h |1 + arch/arm/mach-davinci/include/mach/uncompress.h|1 + drivers/i2c/busses/i2c-davinci.c | 32 ++ drivers/mtd/nand/davinci_nand.c| 80 - drivers
[PATCH v4 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
- AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? - changes for v3: - add comments from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init now used for Interrupt controller init - changes for v4: add comment from Nori Sekhar: - rename davinci emac compatible property to ti,davinci-dm6467-emac - remove pinmux-handle property as discussed here: http://www.spinics.net/lists/arm-kernel/msg175701.html with Nori Sekhar --- arch/arm/boot/dts/enbw_cmc.dts | 172 +++ arch/arm/configs/enbw_cmc_defconfig | 123 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 374 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 680 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..2d5dea9 --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,172 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + model = EnBW CMC; + compatible = enbw,cmc; + + aliases { + ethernet0 = eth0; + }; + + arm { + #address-cells = 1; + #size-cells = 1; + ranges = 0 0xfffee000 0x0002; + intc: interrupt-controller@1 { + compatible = ti,cp_intc; + interrupt-controller; + #interrupt-cells = 1; + ti,intc-size = 101; + reg = 0x0 0x2000; + }; + }; + soc@1c0 { + compatible = ti,da850; + #address-cells = 1; + #size-cells = 1; + ranges = 0x0 0x01c0 0x40; + + serial0: serial@1c42000 { + compatible = ti,da850, ns16550a; + reg = 0x42000 0x100; + clock-frequency = 15000; + reg-shift
Re: [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board
Hello, this v3 patchset is now pending for more than 1 month without seeing comments for it. Are there no more issues? Should I rebase it (if no further comments occur), as it is pending so long? (If so, against which tree?) Thanks. bye, Heiko Heiko Schocher wrote: This patchserie add support for the davinci am1808 based enbw_cmc board. Important: I rebased this patchserie against the irqdomain/next branch from grant likely, as he suggested to rework the OF intcontroller changes to the irqdomain work, branch found here: http://git.secretlab.ca/?p=linux-2.6.git;a=shortlog;h=refs/heads/irqdomain/next git://git.secretlab.ca/git/linux-2.6.git irqdomain/next commit 280ad7fda5f95211857fda38960f2b6fdf6edd3e Author: Grant Likely grant.lik...@secretlab.ca Date: Fri Feb 24 14:58:54 2012 -0700 mfd: twl-core: Add IRQ_DOMAIN dependency changes for v2: Post this patchserie now as v2, as reworked in the comments I got for the RFC serie. changes for v3: - Interrupt Controller: - comment from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init() is now also for the of case the name of the init function (it calls the new __cp_intc_init() function, which was the old cp_intc_init()). Through this rework the changes for OF is better visible. As the OF case uses the irq_domain rework from Grant Likely, maybe the none OF case can use this also, but this should be tested on a hw ... Got no comments to the following points, I noted in the RFC series, so posting this patchseries with them: - ARM: davinci: configure davinci aemif chipselects through OF not moved to mfd, as mentioned in this discussion: http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-arm-davinci-configure-davinci-aemif-chipselects-through-OF-td7059739.html instead use a phandle in the DTS, so drivers which uses the davinci aemif, can call davinci_aemif_setup_timing_of() This is just thought as an RFC ... The enbw_cmc board support not really need to setup this bus timings, as they are setup in U-Boot ... but I want to post this, as I think, it is a nice to have, and I am not really sure, if this has to be a MFD device (If so, all bus interfaces for other SoCs should be converted also to MFD devices) ... as an example how this can be used I add this to the davinci nand controller OF support patch, in this patchserie. - ARM: davinci: mux: add OF support I want to get rid of the pin setup code in board code ... This patch introduces a davinci_cfg_reg_of() function, which davinci drivers can call, if they found a pinmux-handle, so used in the following drivers in this patchserie: drivers/net/ethernet/ti/davinci_emac drivers/i2c/busses/i2c-davinci.c drivers/mtd/nand/davinci_nand.c - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC board specific callbacks, how to solve this with OF support? Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sergei Shtylyov sshtyl...@mvista.com Heiko Schocher (7): ARM: davinci, intc: Add OF support for TI interrupt controller ARM: davinci: configure davinci aemif chipselects through OF ARM: davinci: mux: add OF support ARM: davinci: net: davinci_emac: add OF support ARM: davinci: i2c: add OF support ARM: mtd: nand: davinci: add OF support for davinci nand controller ARM: davinci: add support for the am1808 based enbw_cmc board .../devicetree/bindings/arm/davinci/aemif.txt | 119 ++ .../bindings/arm/davinci/davinci_emac.txt | 43 +++ .../devicetree/bindings/arm/davinci/i2c.txt| 33 ++ .../devicetree/bindings/arm/davinci/intc.txt | 27 ++ .../devicetree/bindings/arm/davinci/mux.txt| 40 ++ .../devicetree/bindings/arm/davinci/nand.txt | 74 arch/arm/boot/dts/enbw_cmc.dts | 268 ++ arch/arm/configs/enbw_cmc_defconfig| 123 +++ arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/aemif.c | 86 +- arch/arm/mach
[PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board
This patchserie add support for the davinci am1808 based enbw_cmc board. Important: I rebased this patchserie against the irqdomain/next branch from grant likely, as he suggested to rework the OF intcontroller changes to the irqdomain work, branch found here: http://git.secretlab.ca/?p=linux-2.6.git;a=shortlog;h=refs/heads/irqdomain/next git://git.secretlab.ca/git/linux-2.6.git irqdomain/next commit 280ad7fda5f95211857fda38960f2b6fdf6edd3e Author: Grant Likely grant.lik...@secretlab.ca Date: Fri Feb 24 14:58:54 2012 -0700 mfd: twl-core: Add IRQ_DOMAIN dependency changes for v2: Post this patchserie now as v2, as reworked in the comments I got for the RFC serie. changes for v3: - Interrupt Controller: - comment from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init() is now also for the of case the name of the init function (it calls the new __cp_intc_init() function, which was the old cp_intc_init()). Through this rework the changes for OF is better visible. As the OF case uses the irq_domain rework from Grant Likely, maybe the none OF case can use this also, but this should be tested on a hw ... Got no comments to the following points, I noted in the RFC series, so posting this patchseries with them: - ARM: davinci: configure davinci aemif chipselects through OF not moved to mfd, as mentioned in this discussion: http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-arm-davinci-configure-davinci-aemif-chipselects-through-OF-td7059739.html instead use a phandle in the DTS, so drivers which uses the davinci aemif, can call davinci_aemif_setup_timing_of() This is just thought as an RFC ... The enbw_cmc board support not really need to setup this bus timings, as they are setup in U-Boot ... but I want to post this, as I think, it is a nice to have, and I am not really sure, if this has to be a MFD device (If so, all bus interfaces for other SoCs should be converted also to MFD devices) ... as an example how this can be used I add this to the davinci nand controller OF support patch, in this patchserie. - ARM: davinci: mux: add OF support I want to get rid of the pin setup code in board code ... This patch introduces a davinci_cfg_reg_of() function, which davinci drivers can call, if they found a pinmux-handle, so used in the following drivers in this patchserie: drivers/net/ethernet/ti/davinci_emac drivers/i2c/busses/i2c-davinci.c drivers/mtd/nand/davinci_nand.c - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC board specific callbacks, how to solve this with OF support? Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sergei Shtylyov sshtyl...@mvista.com Heiko Schocher (7): ARM: davinci, intc: Add OF support for TI interrupt controller ARM: davinci: configure davinci aemif chipselects through OF ARM: davinci: mux: add OF support ARM: davinci: net: davinci_emac: add OF support ARM: davinci: i2c: add OF support ARM: mtd: nand: davinci: add OF support for davinci nand controller ARM: davinci: add support for the am1808 based enbw_cmc board .../devicetree/bindings/arm/davinci/aemif.txt | 119 ++ .../bindings/arm/davinci/davinci_emac.txt | 43 +++ .../devicetree/bindings/arm/davinci/i2c.txt| 33 ++ .../devicetree/bindings/arm/davinci/intc.txt | 27 ++ .../devicetree/bindings/arm/davinci/mux.txt| 40 ++ .../devicetree/bindings/arm/davinci/nand.txt | 74 arch/arm/boot/dts/enbw_cmc.dts | 268 ++ arch/arm/configs/enbw_cmc_defconfig| 123 +++ arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/aemif.c | 86 +- arch/arm/mach-davinci/board-enbw-cmc.c | 380 arch/arm/mach-davinci/cp_intc.c| 87 - arch/arm/mach-davinci/include/mach/aemif.h |1 + arch/arm/mach-davinci/include/mach/mux.h |2 + arch/arm/mach-davinci/include/mach/uncompress.h|1 + arch/arm/mach-davinci/mux.c| 73 - drivers
[PATCH v3 5/7] ARM: davinci: i2c: add OF support
add of support for the davinci i2c driver. Signed-off-by: Heiko Schocher h...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Grant Likely grant.lik...@secretlab.ca Cc: Sekhar Nori nsek...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - changes for v2: - add comments from Sylwester Nawrocki s.nawro...@samsung.com: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - no changes for v3 .../devicetree/bindings/arm/davinci/i2c.txt| 33 + drivers/i2c/busses/i2c-davinci.c | 37 2 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..ba00d7b --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt @@ -0,0 +1,33 @@ +* Texas Instruments Davinci I2C + +This file provides information, what the device node for the +davinci i2c interface contain. + +Required properties: +- compatible: ti,davinci-i2c; +- reg : Offset and length of the register set for the device + +Recommended properties : +- interrupts : a standard interrupt property. +- clock-frequency : desired I2C bus clock frequency in Hz. + +Optional properties: +- bus-delay: bus delay in usec +- pinmux-handle: Contains a handle to configure the pinmux settings. + +Example (enbw_cmc board): + i2c@1c22000 { + compatible = ti,davinci-i2c; + reg = 0x22000 0x1000; + clock-frequency = 10; + interrupts = 15; + interrupt-parent = intc; + pinmux-handle = i2c1_pins; + #address-cells = 1; + #size-cells = 0; + + dtt@48 { + compatible = national,lm75; + reg = 0x48; + }; + }; diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..0d07d02 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,9 +38,12 @@ #include linux/slab.h #include linux/cpufreq.h #include linux/gpio.h +#include linux/of_i2c.h +#include linux/of_device.h #include mach/hardware.h #include mach/i2c.h +#include mach/mux.h /* - global defines --- */ @@ -635,6 +638,12 @@ static struct i2c_algorithm i2c_davinci_algo = { .functionality = i2c_davinci_func, }; +static const struct of_device_id davinci_i2c_of_match[] = { + {.compatible = ti,davinci-i2c, }, + {}, +}; +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); + static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; @@ -676,6 +685,31 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev-irq = irq-start; platform_set_drvdata(pdev, dev); + if ((dev-dev-platform_data == NULL) + (pdev-dev.of_node)) { + struct device_node *pinmux_np; + struct davinci_i2c_platform_data *pdata; + u32 prop; + + pdata = devm_kzalloc(pdev-dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + r = -ENOMEM; + goto err_free_mem; + } + memcpy(pdata, davinci_i2c_platform_data_default, + sizeof(*pdata)); + dev-dev-platform_data = pdata; + if (!of_property_read_u32(pdev-dev.of_node, clock-frequency, + prop)) + pdata-bus_freq = prop / 1000; + if (!of_property_read_u32(pdev-dev.of_node, bus-delay, + prop)) + pdata-bus_delay = prop; + pinmux_np = of_parse_phandle(pdev-dev.of_node, + pinmux-handle, 0); + if (pinmux_np) + davinci_cfg_reg_of(pinmux_np); + } dev-clk = clk_get(pdev-dev, NULL); if (IS_ERR(dev-clk)) { r = -ENODEV; @@ -711,6 +745,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) adap-algo = i2c_davinci_algo; adap-dev.parent = pdev-dev; adap-timeout = DAVINCI_I2C_TIMEOUT; + adap-dev.of_node = pdev-dev.of_node; adap-nr = pdev-id; r
[PATCH v3 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
- AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? - changes for v3: - add comments from Sergei Shtylyov: - rename compatible prop to ti,cp_intc - cp_intc_init now used for Interrupt controller init arch/arm/boot/dts/enbw_cmc.dts | 268 arch/arm/configs/enbw_cmc_defconfig | 123 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 380 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 782 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..143b2e2 --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,268 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + model = EnBW CMC; + compatible = enbw,cmc; + + aliases { + ethernet0 = eth0; + }; + + arm { + #address-cells = 1; + #size-cells = 1; + ranges = 0 0xfffee000 0x0002; + intc: interrupt-controller@1 { + compatible = ti,cp_intc; + interrupt-controller; + #interrupt-cells = 1; + ti,intc-size = 101; + reg = 0x0 0x2000; + }; + }; + soc@1c0 { + compatible = ti,da850; + #address-cells = 1; + #size-cells = 1; + ranges = 0x0 0x01c0 0x40; + + serial0: serial@1c42000 { + compatible = ti,da850, ns16550a; + reg = 0x42000 0x100; + clock-frequency = 15000; + reg-shift = 2; + interrupts = 25; + interrupt-parent = intc; + }; + serial1: serial@1d0c000 { + compatible = ti,da850, ns16550a; + reg
[PATCH v2 5/7] ARM: davinci: i2c: add OF support
add of support for the davinci i2c driver. Signed-off-by: Heiko Schocher h...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Grant Likely grant.lik...@secretlab.ca Cc: Sekhar Nori nsek...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - changes for v2: - add comments from Sylwester Nawrocki s.nawro...@samsung.com: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue .../devicetree/bindings/arm/davinci/i2c.txt| 33 + drivers/i2c/busses/i2c-davinci.c | 37 2 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..ba00d7b --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt @@ -0,0 +1,33 @@ +* Texas Instruments Davinci I2C + +This file provides information, what the device node for the +davinci i2c interface contain. + +Required properties: +- compatible: ti,davinci-i2c; +- reg : Offset and length of the register set for the device + +Recommended properties : +- interrupts : a standard interrupt property. +- clock-frequency : desired I2C bus clock frequency in Hz. + +Optional properties: +- bus-delay: bus delay in usec +- pinmux-handle: Contains a handle to configure the pinmux settings. + +Example (enbw_cmc board): + i2c@1c22000 { + compatible = ti,davinci-i2c; + reg = 0x22000 0x1000; + clock-frequency = 10; + interrupts = 15; + interrupt-parent = intc; + pinmux-handle = i2c1_pins; + #address-cells = 1; + #size-cells = 0; + + dtt@48 { + compatible = national,lm75; + reg = 0x48; + }; + }; diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..0d07d02 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,9 +38,12 @@ #include linux/slab.h #include linux/cpufreq.h #include linux/gpio.h +#include linux/of_i2c.h +#include linux/of_device.h #include mach/hardware.h #include mach/i2c.h +#include mach/mux.h /* - global defines --- */ @@ -635,6 +638,12 @@ static struct i2c_algorithm i2c_davinci_algo = { .functionality = i2c_davinci_func, }; +static const struct of_device_id davinci_i2c_of_match[] = { + {.compatible = ti,davinci-i2c, }, + {}, +}; +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); + static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; @@ -676,6 +685,31 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev-irq = irq-start; platform_set_drvdata(pdev, dev); + if ((dev-dev-platform_data == NULL) + (pdev-dev.of_node)) { + struct device_node *pinmux_np; + struct davinci_i2c_platform_data *pdata; + u32 prop; + + pdata = devm_kzalloc(pdev-dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + r = -ENOMEM; + goto err_free_mem; + } + memcpy(pdata, davinci_i2c_platform_data_default, + sizeof(*pdata)); + dev-dev-platform_data = pdata; + if (!of_property_read_u32(pdev-dev.of_node, clock-frequency, + prop)) + pdata-bus_freq = prop / 1000; + if (!of_property_read_u32(pdev-dev.of_node, bus-delay, + prop)) + pdata-bus_delay = prop; + pinmux_np = of_parse_phandle(pdev-dev.of_node, + pinmux-handle, 0); + if (pinmux_np) + davinci_cfg_reg_of(pinmux_np); + } dev-clk = clk_get(pdev-dev, NULL); if (IS_ERR(dev-clk)) { r = -ENODEV; @@ -711,6 +745,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) adap-algo = i2c_davinci_algo; adap-dev.parent = pdev-dev; adap-timeout = DAVINCI_I2C_TIMEOUT; + adap-dev.of_node = pdev-dev.of_node; adap-nr = pdev-id; r = i2c_add_numbered_adapter(adap
[PATCH v2 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board
This patchserie adds support for the davinci am1808 based enbw_cmc board. Post this patchserie now as v2, as reworked in the comments I got for the RFC serie. Important: I rebased this patchserie against the irqdomain/next branch from grant likely, as he suggested to rework the OF intcontroller changes to the irqdomain work, branch found here: http://git.secretlab.ca/?p=linux-2.6.git;a=shortlog;h=refs/heads/irqdomain/next commit 2462bacd0334d918f9fcd79fc59c403b76b36f8a Author: Grant Likely grant.lik...@secretlab.ca Date: Thu Jan 26 14:10:13 2012 -0700 irq_domain/microblaze: Convert microblaze to use irq_domains Got no comments to the following points, I noted in the RFC series, so posting this patchseries with them: - ARM: davinci: configure davinci aemif chipselects through OF not moved to mfd, as mentioned in this discussion: http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-arm-davinci-configure-davinci-aemif-chipselects-through-OF-td7059739.html instead use a phandle in the DTS, so drivers which uses the davinci aemif, can call davinci_aemif_setup_timing_of() This is just thought as an RFC ... The enbw_cmc board support not really need to setup this bus timings, as they are setup in U-Boot ... but I want to post this, as I think, it is a nice to have, and I am not really sure, if this has to be a MFD device (If so, all bus interfaces for other SoCs should be converted also to MFD devices) ... as an example how this can be used I add this to the davinci nand controller OF support patch, in this patchserie. - ARM: davinci: mux: add OF support I want to get rid of the pin setup code in board code ... This patch introduces a davinci_cfg_reg_of() function, which davinci drivers can call, if they found a pinmux-handle, so used in the following drivers in this patchserie: drivers/net/ethernet/ti/davinci_emac drivers/i2c/busses/i2c-davinci.c drivers/mtd/nand/davinci_nand.c - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC board specific callbacks, how to solve this with OF support? Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Heiko Schocher (7): ARM: davinci, intc: Add OF support for TI interrupt controller ARM: davinci: configure davinci aemif chipselects through OF ARM: davinci: mux: add OF support ARM: davinci: net: davinci_emac: add OF support ARM: davinci: i2c: add OF support ARM: mtd: nand: davinci: add OF support for davinci nand controller ARM: davinci: add support for the am1808 based enbw_cmc board .../devicetree/bindings/arm/davinci/aemif.txt | 119 ++ .../bindings/arm/davinci/davinci_emac.txt | 43 +++ .../devicetree/bindings/arm/davinci/i2c.txt| 33 ++ .../devicetree/bindings/arm/davinci/intc.txt | 26 ++ .../devicetree/bindings/arm/davinci/mux.txt| 40 ++ .../devicetree/bindings/arm/davinci/nand.txt | 74 arch/arm/boot/dts/enbw_cmc.dts | 268 ++ arch/arm/configs/enbw_cmc_defconfig| 123 +++ arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/aemif.c | 86 +- arch/arm/mach-davinci/board-enbw-cmc.c | 380 arch/arm/mach-davinci/cp_intc.c| 133 +++ arch/arm/mach-davinci/include/mach/aemif.h |1 + arch/arm/mach-davinci/include/mach/cp_intc.h |1 + arch/arm/mach-davinci/include/mach/mux.h |2 + arch/arm/mach-davinci/include/mach/uncompress.h|1 + arch/arm/mach-davinci/mux.c| 73 - drivers/i2c/busses/i2c-davinci.c | 37 ++ drivers/mtd/nand/davinci_nand.c| 85 +- drivers/net/ethernet/ti/davinci_emac.c | 94 +- 21 files changed, 1625 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/aemif.txt create mode 100644 Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt create mode 100644 Documentation/devicetree/bindings/arm/davinci/intc.txt create mode
[PATCH v2 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
- AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Sylwester Nawrocki s.nawro...@samsung.com --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? - changes for v2: - changes in the nand node due to comments from Scott Wood: - add ti,davinci- prefix - Dashes are preferred to underscores - rename nandflash to nand - introduce new ti,davinci specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines - changes for i2c due to comments from Sylwester Nawrocki: - use cell-index instead id - OF_DEV_AUXDATA in the machine code, instead pre-define platform device name - add comment from Grant Likely for i2c: - removed id resp. cell-index completely - fixed documentation - use of_match_ptr() - use devm_kzalloc() for allocating plattform data mem - fixed a whitespace issue - add net comments from Grant Likely: - add prefix ti,davinci- to davinci specific property names - remove version property - use compatible name ti,davinci-dm6460-emac - add comment from Grant Likely: - rename compatible node - do not use cell-index - CONFIG_OF required for this board TODO: - create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step? arch/arm/boot/dts/enbw_cmc.dts | 268 arch/arm/configs/enbw_cmc_defconfig | 123 arch/arm/mach-davinci/Kconfig |9 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 380 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 782 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..df41f85 --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,268 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + model = EnBW CMC; + compatible = enbw,cmc; + + aliases { + ethernet0 = eth0; + }; + + arm { + #address-cells = 1; + #size-cells = 1; + ranges = 0 0xfffee000 0x0002; + intc: interrupt-controller@1 { + compatible = ti,davinci-intc; + interrupt-controller; + #interrupt-cells = 1; + ti,intc-size = 101; + reg = 0x0 0x2000; + }; + }; + soc@1c0 { + compatible = ti,da850; + #address-cells = 1; + #size-cells = 1; + ranges = 0x0 0x01c0 0x40; + + serial0: serial@1c42000 { + compatible = ti,da850, ns16550a; + reg = 0x42000 0x100; + clock-frequency = 15000; + reg-shift = 2; + interrupts = 25; + interrupt-parent = intc; + }; + serial1: serial@1d0c000 { + compatible = ti,da850, ns16550a; + reg = 0x10c000 0x100; + clock-frequency = 15000; + reg-shift = 2; + interrupts = 53
Re: [RFC PATCH 5/7] ARM: davinci: i2c: add OF support
Hello Ben, Ben Dooks wrote: On Mon, Jan 23, 2012 at 09:56:05AM +0100, Heiko Schocher wrote: add of support for the davinci i2c driver. Signed-off-by: Heiko Schocher h...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Grant Likely grant.lik...@secretlab.ca Cc: Sekhar Nori nsek...@ti.com Cc: Wolfgang Denk w...@denx.de --- .../devicetree/bindings/arm/davinci/i2c.txt| 39 ++ drivers/i2c/busses/i2c-davinci.c | 43 2 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..94ec670 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt [...] +Optional properties: +- bus-delay: bus delay in usec bus_delay sounds rather like frequency in a different name, what is it for? from drivers/i2c/busses/i2c-davinci.c i2c_davinci_xfer_msg(): /* Introduce a delay, required for some boards (e.g Davinci EVM) */ if (pdata-bus_delay) udelay(pdata-bus_delay); so I added this option to OF support too, but I do not know more about this feature ... [...] diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..6f59fae 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,9 +38,12 @@ [...] +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); +#else +#define davinci_i2c_of_match NULL +#endif see of_match_ptr() and you won't need the #else. Yep, already fixed, as Grant Likely commented. static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; @@ -676,7 +689,34 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev-irq = irq-start; platform_set_drvdata(pdev, dev); +if ((dev-dev-platform_data == NULL) +(pdev-dev.of_node)) { If there's platform_data an of_node, what happens then? Then platform_data is used. +struct device_node *pinmux_np; +struct davinci_i2c_platform_data *pdata; +u32 prop; + +dev-dev-platform_data = davinci_i2c_platform_data_default; +pdata = davinci_i2c_platform_data_default; +if (!of_property_read_u32(pdev-dev.of_node, clock-frequency, +prop)) +pdata-bus_freq = prop / 1000; +if (!of_property_read_u32(pdev-dev.of_node, bus-delay, +prop)) +pdata-bus_delay = prop; +if (!of_property_read_u32(pdev-dev.of_node, id, +prop)) { +pdev-id = prop; +pdev-dev.init_name = kzalloc(20, GFP_KERNEL); +sprintf((char *)pdev-dev.init_name, +i2c_davinci.%d, pdev-id); +} Is this _really_ necessary, looks a bit of a hack to me. Yep, id completely removed, as Grant Likely commented too. [...] Thanks for looking through this. Posting v2 soon. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board
Hello Grant, Grant Likely wrote: On Mon, Jan 23, 2012 at 09:56:07AM +0100, Heiko Schocher wrote: - AM1808 based board - 64 MiB DDR ram - 2 MiB Nor flash - 128 MiB NAND flash - use internal RTC - I2C support - hwmon lm75 support - UBI/UBIFS support - MMC support - USB OTG support Signed-off-by: Heiko Schocher h...@denx.de Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-...@lists.infradead.org Cc: linux-i2c@vger.kernel.org Cc: net...@vger.kernel.org Cc: David Woodhouse dw...@infradead.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Sekhar Nori nsek...@ti.com Cc: Kevin Hilman khil...@ti.com Cc: Wolfgang Denk w...@denx.de --- - post this board support with USB support, even though USB is only working with the 10 ms workaround, posted here: http://comments.gmane.org/gmane.linux.usb.general/54505 I see this issue also on the AM1808 TMDXEXP1808L evalboard. - MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support? Can you give me a hint, how to add callbacks to OF support? arch/arm/boot/dts/enbw_cmc.dts | 286 + arch/arm/configs/enbw_cmc_defconfig | 125 arch/arm/mach-davinci/Kconfig |8 + arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-enbw-cmc.c | 384 +++ arch/arm/mach-davinci/include/mach/uncompress.h |1 + 6 files changed, 805 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c diff --git a/arch/arm/boot/dts/enbw_cmc.dts b/arch/arm/boot/dts/enbw_cmc.dts new file mode 100644 index 000..e5995ce --- /dev/null +++ b/arch/arm/boot/dts/enbw_cmc.dts @@ -0,0 +1,286 @@ +/* + * Device Tree for the EnBW CMC plattform + * + * Copyright 2011 DENX Software Engineering GmbH + * Heiko Schocher h...@denx.de + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +/dts-v1/; +/include/ skeleton.dtsi + +/ { +model = EnBW CMC; +compatible = enbw,cmc; + +aliases { +ethernet0 = eth0; +}; + +arm { +#address-cells = 1; +#size-cells = 1; +ranges = 0 0xfffee000 0x0002; +intc: interrupt-controller@1 { +compatible = ti,davinci-intc; +interrupt-controller; +#interrupt-cells = 1; +ti,intc-size = 101; +reg = 0x0 0x2000; +}; +}; +soc@1c0 { +compatible = ti,da8xx; As previously mentioned, using wildcard ('x') characters in compatible properties is bad practice. Always be specific and use the compatible list to make sure the correct driver gets bound (assuming the device is 100% register level compatible with the older one). fixed. +#address-cells = 1; +#size-cells = 1; +ranges = 0x0 0x01c0 0x40; + +serial0: serial@1c42000 { +cell-index = 2; As previously mentioned, don't use cell index. If you *really* need to assign a number to a device, then use a property in the /aliases node and make sure pdev-id does *not* get modified. removed, as not needed. +compatible = ns16550a; Should include a string for the specific device. Something like: compatible = ti,da800, ns16550a; added. diff --git a/arch/arm/mach-davinci/board-enbw-cmc.c b/arch/arm/mach-davinci/board-enbw-cmc.c new file mode 100644 index 000..4473c4a --- /dev/null +++ b/arch/arm/mach-davinci/board-enbw-cmc.c @@ -0,0 +1,384 @@ [...] +#if defined(CONFIG_OF) +static __init void enbw_cmc_usb_init(void) All the focus is on DT now. How about making CONFIG_OF required for this board? Also, this is just another board file. The focus should fixed. be on creating a generic board support file for DT platforms. move the arch/arm/mach-davinci/board-enbw-cmc.c to arch/arm/mach-davinci/board-da850_simple.c and do it like arch/powerpc/platforms/52xx/mpc5200_simple.c ? and extract common nodes from arch/arm/boot/dts/enbw_cmc.dts to arch/arm/boot/dts/da850.dtsi? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c
Re: [RFC PATCH 5/7] ARM: davinci: i2c: add OF support
Hello Grant, Grant Likely wrote: On Mon, Jan 23, 2012 at 09:56:05AM +0100, Heiko Schocher wrote: add of support for the davinci i2c driver. Signed-off-by: Heiko Schocher h...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooks ben-li...@fluff.org Cc: Wolfram Sang w.s...@pengutronix.de Cc: Grant Likely grant.lik...@secretlab.ca Cc: Sekhar Nori nsek...@ti.com Cc: Wolfgang Denk w...@denx.de Hi Heiko, comments below. Thanks! --- .../devicetree/bindings/arm/davinci/i2c.txt| 39 ++ drivers/i2c/busses/i2c-davinci.c | 43 2 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..94ec670 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt @@ -0,0 +1,39 @@ +* Texas Instruments Davinci I2C + +This file provides information, what the device node for the +davinci i2c interface contain. + +Required properties: +- compatible: ti,davinci-i2c; +- reg : Offset and length of the register set for the device +- id: id of the controller Don't use an 'id' property. i2c bus numbers should be dynamically assigned when using the device tree. Yep, removed! + +Recommended properties : +- interrupts : a b where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This is inaccurate. It is entirely defined by the interrupt controller. All you need to say here is that this is a standard interrupts property. fixed. +- interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. Don't even mention this one. It can often be inherited from a parent node. deleted. [...] diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index a76d85f..6f59fae 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -38,9 +38,12 @@ #include linux/slab.h #include linux/cpufreq.h #include linux/gpio.h +#include linux/of_i2c.h +#include linux/of_device.h #include mach/hardware.h #include mach/i2c.h +#include mach/mux.h /* - global defines --- */ @@ -635,6 +638,16 @@ static struct i2c_algorithm i2c_davinci_algo = { .functionality = i2c_davinci_func, }; +#if defined(CONFIG_OF) +static const struct of_device_id davinci_i2c_of_match[] = { +{.compatible = ti,davinci-i2c, }, +{}, +} +MODULE_DEVICE_TABLE(of, davinci_i2c_of_match); +#else +#define davinci_i2c_of_match NULL +#endif The #else clause can be dropped if you use the of_match_ptr() macro when referencing it. removed. + static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; @@ -676,7 +689,34 @@ static int davinci_i2c_probe(struct platform_device *pdev) dev-irq = irq-start; platform_set_drvdata(pdev, dev); +if ((dev-dev-platform_data == NULL) +(pdev-dev.of_node)) { +struct device_node *pinmux_np; +struct davinci_i2c_platform_data *pdata; +u32 prop; + +dev-dev-platform_data = davinci_i2c_platform_data_default; Don't do this. What if a davinci part shows up with two i2c busses? Use devm_kzalloc() instead. Fixed. +pdata = davinci_i2c_platform_data_default; +if (!of_property_read_u32(pdev-dev.of_node, clock-frequency, +prop)) +pdata-bus_freq = prop / 1000; +if (!of_property_read_u32(pdev-dev.of_node, bus-delay, +prop)) +pdata-bus_delay = prop; +if (!of_property_read_u32(pdev-dev.of_node, id, +prop)) { +pdev-id = prop; +pdev-dev.init_name = kzalloc(20, GFP_KERNEL); +sprintf((char *)pdev-dev.init_name, +i2c_davinci.%d, pdev-id); Blech! Drop this. Leave the core code to set the device name. completely removed. dev-clk = clk_get(pdev-dev, NULL); + if (IS_ERR(dev-clk)) { Nit: unrelated whitespace change Ups, good catch, fixed. [...] bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH 5/7] ARM: davinci: i2c: add OF support
Hello Sylwester, Sylwester Nawrocki wrote: Hello, On 01/23/2012 09:56 AM, Heiko Schocher wrote: add of support for the davinci i2c driver. Signed-off-by: Heiko Schocherh...@denx.de Cc: davinci-linux-open-sou...@linux.davincidsp.com Cc: linux-arm-ker...@lists.infradead.org Cc: devicetree-disc...@lists.ozlabs.org Cc: linux-i2c@vger.kernel.org Cc: Ben Dooksben-li...@fluff.org Cc: Wolfram Sangw.s...@pengutronix.de Cc: Grant Likelygrant.lik...@secretlab.ca Cc: Sekhar Norinsek...@ti.com Cc: Wolfgang Denkw...@denx.de --- .../devicetree/bindings/arm/davinci/i2c.txt| 39 ++ drivers/i2c/busses/i2c-davinci.c | 43 2 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/i2c.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/i2c.txt b/Documentation/devicetree/bindings/arm/davinci/i2c.txt new file mode 100644 index 000..94ec670 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/i2c.txt @@ -0,0 +1,39 @@ +* Texas Instruments Davinci I2C + +This file provides information, what the device node for the +davinci i2c interface contain. + +Required properties: +- compatible: ti,davinci-i2c; +- reg : Offset and length of the register set for the device +- id: id of the controller I was wondering whether we're supposed to use cell-index property name for such a device instance index? or doesn't it really matter and id is fine? Such an IP instance index seems quite common so I thought it could be easier to follow to use standard name. I just copied the name from struct davinci_nand_pdata ... it is used in the davinci_nand driver as chipselect ... maybe it is better I rename this to chipselect ? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- To unsubscribe from this list: send the line unsubscribe linux-i2c in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html