* [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board @ 2012-03-05 11:09 Heiko Schocher 2012-03-05 11:10 ` [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support Heiko Schocher [not found] ` <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org> 0 siblings, 2 replies; 8+ messages in thread From: Heiko Schocher @ 2012-03-05 11:09 UTC (permalink / raw) To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/ Cc: Heiko Schocher, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-i2c-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, David Woodhouse, Ben Dooks, Wolfram Sang, Sekhar Nori, Kevin Hilman, Wolfgang Denk, Sergei Shtylyov 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.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> 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 <hs-ynQEQJNshbs@public.gmane.org> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Cc: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org> Cc: Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org> Cc: Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org> 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/i2c/busses/i2c-davinci.c | 37 ++ drivers/mtd/nand/davinci_nand.c | 85 +++++- drivers/net/ethernet/ti/davinci_emac.c | 94 +++++- 20 files changed, 1569 insertions(+), 14 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 100644 Documentation/devicetree/bindings/arm/davinci/mux.txt create mode 100644 Documentation/devicetree/bindings/arm/davinci/nand.txt 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 -- 1.7.7.6 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support 2012-03-05 11:09 [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher @ 2012-03-05 11:10 ` Heiko Schocher 2012-05-15 18:08 ` Nori, Sekhar [not found] ` <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Heiko Schocher @ 2012-03-05 11:10 UTC (permalink / raw) To: davinci-linux-open-source Cc: Heiko Schocher, linux-arm-kernel, devicetree-discuss, netdev, Grant Likely, Sekhar Nori, Wolfgang Denk, Anatoly Sivov add of support for the davinci_emac driver. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: davinci-linux-open-source@linux.davincidsp.com Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree-discuss@lists.ozlabs.org Cc: netdev@vger.kernel.org Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Sekhar Nori <nsekhar@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Anatoly Sivov <mm05@mail.ru> --- - changes for v2: - add comment from Anatoly Sivov - fix typo in davinci_emac.txt - add comment from Grant Likely: - add prefix "ti,davinci-" to davinci specific property names - remove version property - use compatible name "ti,davinci-dm6460-emac" - use devm_kzalloc() - use of_match_ptr() - document all new properties - remove of_address_to_resource() and do not overwrite resource table - whitespace fixes - remove hw_ram_addr as it is not used in current board code - no changes for v3 .../bindings/arm/davinci/davinci_emac.txt | 43 +++++++++ drivers/net/ethernet/ti/davinci_emac.c | 94 +++++++++++++++++++- 2 files changed, 136 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt diff --git a/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt new file mode 100644 index 0000000..a7b0911 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt @@ -0,0 +1,43 @@ +* Texas Instruments Davinci EMAC + +This file provides information, what the device node +for the davinci_emac interface contain. + +Required properties: +- compatible: "ti,davinci-dm6460-emac"; +- reg: Offset and length of the register set for the device +- ti,davinci-ctrl-reg-offset: offset to control register +- ti,davinci-ctrl-mod-reg-offset: offset to control module register +- ti,davinci-ctrl-ram-offset: offset to control module ram +- ti,davinci-ctrl-ram-size: size of control module ram +- ti,davinci-rmii-en: use RMII +- ti,davinci-no-bd-ram: has the emac controller BD RAM +- phy-handle: Contains a phandle to an Ethernet PHY. + if not, davinci_emac driver defaults to 100/FULL +- interrupts: interrupt mapping for the davinci emac interrupts sources: + 4 sources: <Receive Threshold Interrupt + Receive Interrupt + Transmit Interrupt + Miscellaneous Interrupt> +- pinmux-handle: Contains a handle to configure the pinmux settings. + +Optional properties: +- local-mac-address : 6 bytes, mac address + +Example (enbw_cmc board): + eth0: emac@1e20000 { + compatible = "ti,davinci-dm6460-emac"; + reg = <0x220000 0x4000>; + ti,davinci-ctrl-reg-offset = <0x3000>; + ti,davinci-ctrl-mod-reg-offset = <0x2000>; + ti,davinci-ctrl-ram-offset = <0>; + ti,davinci-ctrl-ram-size = <0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <33 + 34 + 35 + 36 + >; + interrupt-parent = <&intc>; + pinmux-handle = <&emac_pins>; + }; diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 4fa0bcb..56e1c35 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -58,6 +58,12 @@ #include <linux/io.h> #include <linux/uaccess.h> #include <linux/davinci_emac.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> +#include <linux/of_net.h> + +#include <mach/mux.h> #include <asm/irq.h> #include <asm/page.h> @@ -339,6 +345,9 @@ struct emac_priv { u32 rx_addr_type; atomic_t cur_tx; const char *phy_id; +#ifdef CONFIG_OF + struct device_node *phy_node; +#endif struct phy_device *phydev; spinlock_t lock; /*platform specific members*/ @@ -1760,6 +1769,82 @@ static const struct net_device_ops emac_netdev_ops = { #endif }; +#ifdef CONFIG_OF +static struct emac_platform_data + *davinci_emac_of_get_pdata(struct platform_device *pdev, + struct emac_priv *priv) +{ + struct device_node *np; + struct device_node *pinmux_np; + struct emac_platform_data *pdata = NULL; + const u8 *mac_addr; + u32 data; + int ret; + int version; + + np = pdev->dev.of_node; + if (!np) + goto nodata; + else + version = EMAC_VERSION_2; + + pdata = pdev->dev.platform_data; + if (!pdata) { + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + goto nodata; + } + pdata->version = version; + + mac_addr = of_get_mac_address(np); + if (mac_addr) + memcpy(pdata->mac_addr, mac_addr, ETH_ALEN); + + ret = of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &data); + if (!ret) + pdata->ctrl_reg_offset = data; + + ret = of_property_read_u32(np, "ti,davinci-ctrl-mod-reg-offset", + &data); + if (!ret) + pdata->ctrl_mod_reg_offset = data; + + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-offset", &data); + if (!ret) + pdata->ctrl_ram_offset = data; + + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-size", &data); + if (!ret) + pdata->ctrl_ram_size = data; + + ret = of_property_read_u32(np, "ti,davinci-rmii-en", &data); + if (!ret) + pdata->rmii_en = data; + + ret = of_property_read_u32(np, "ti,davinci-no-bd-ram", &data); + if (!ret) + pdata->no_bd_ram = data; + + priv->phy_node = of_parse_phandle(np, "phy-handle", 0); + if (!priv->phy_node) + pdata->phy_id = ""; + + pinmux_np = of_parse_phandle(np, "pinmux-handle", 0); + if (pinmux_np) + davinci_cfg_reg_of(pinmux_np); + + pdev->dev.platform_data = pdata; +nodata: + return pdata; +} +#else +static struct emac_platform_data + *davinci_emac_of_get_pdata(struct platform_device *pdev, + struct emac_priv *priv) +{ + return pdev->dev.platform_data; +} +#endif /** * davinci_emac_probe: EMAC device probe * @pdev: The DaVinci EMAC device that we are removing @@ -1803,7 +1888,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) spin_lock_init(&priv->lock); - pdata = pdev->dev.platform_data; + pdata = davinci_emac_of_get_pdata(pdev, priv); if (!pdata) { dev_err(&pdev->dev, "no platform data\n"); rc = -ENODEV; @@ -2013,6 +2098,12 @@ static const struct dev_pm_ops davinci_emac_pm_ops = { .resume = davinci_emac_resume, }; +static const struct of_device_id davinci_emac_of_match[] = { + {.compatible = "ti,davinci-dm6460-emac", }, + {}, +}; +MODULE_DEVICE_TABLE(of, davinci_emac_of_match); + /** * davinci_emac_driver: EMAC platform driver structure */ @@ -2021,6 +2112,7 @@ static struct platform_driver davinci_emac_driver = { .name = "davinci_emac", .owner = THIS_MODULE, .pm = &davinci_emac_pm_ops, + .of_match_table = of_match_ptr(davinci_emac_of_match), }, .probe = davinci_emac_probe, .remove = __devexit_p(davinci_emac_remove), -- 1.7.7.6 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support 2012-03-05 11:10 ` [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support Heiko Schocher @ 2012-05-15 18:08 ` Nori, Sekhar 2012-05-17 6:32 ` Heiko Schocher 0 siblings, 1 reply; 8+ messages in thread From: Nori, Sekhar @ 2012-05-15 18:08 UTC (permalink / raw) To: Heiko Schocher, davinci-linux-open-source@linux.davincidsp.com Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org, Grant Likely, Wolfgang Denk, Anatoly Sivov Hi Heiko, On Mon, Mar 05, 2012 at 16:40:01, Heiko Schocher wrote: > add of support for the davinci_emac driver. > > Signed-off-by: Heiko Schocher <hs@denx.de> > Cc: davinci-linux-open-source@linux.davincidsp.com > Cc: linux-arm-kernel@lists.infradead.org > Cc: devicetree-discuss@lists.ozlabs.org > Cc: netdev@vger.kernel.org > Cc: Grant Likely <grant.likely@secretlab.ca> > Cc: Sekhar Nori <nsekhar@ti.com> > Cc: Wolfgang Denk <wd@denx.de> > Cc: Anatoly Sivov <mm05@mail.ru> > > --- > - changes for v2: > - add comment from Anatoly Sivov > - fix typo in davinci_emac.txt > - add comment from Grant Likely: > - add prefix "ti,davinci-" to davinci specific property names > - remove version property > - use compatible name "ti,davinci-dm6460-emac" > - use devm_kzalloc() > - use of_match_ptr() > - document all new properties > - remove of_address_to_resource() and do not overwrite > resource table > - whitespace fixes > - remove hw_ram_addr as it is not used in current > board code > - no changes for v3 > > .../bindings/arm/davinci/davinci_emac.txt | 43 +++++++++ > drivers/net/ethernet/ti/davinci_emac.c | 94 +++++++++++++++++++- > 2 files changed, 136 insertions(+), 1 deletions(-) > create mode 100644 Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt > > diff --git a/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt > new file mode 100644 > index 0000000..a7b0911 > --- /dev/null > +++ b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt Since DaVinci EMAC driver may be used on platforms other than DaVinci (c6x, OMAP), can we place the bindings documentation in bindings/net/? > @@ -0,0 +1,43 @@ > +* Texas Instruments Davinci EMAC > + > +This file provides information, what the device node > +for the davinci_emac interface contain. s/contain/contains > + > +Required properties: > +- compatible: "ti,davinci-dm6460-emac"; There is no device called dm6460. If you intend to only support "version 2" of the EMAC IP at this time, you can use dm6467 (http://www.ti.com/product/tms320dm6467) > +- reg: Offset and length of the register set for the device > +- ti,davinci-ctrl-reg-offset: offset to control register > +- ti,davinci-ctrl-mod-reg-offset: offset to control module register > +- ti,davinci-ctrl-ram-offset: offset to control module ram > +- ti,davinci-ctrl-ram-size: size of control module ram > +- ti,davinci-rmii-en: use RMII > +- ti,davinci-no-bd-ram: has the emac controller BD RAM > +- phy-handle: Contains a phandle to an Ethernet PHY. > + if not, davinci_emac driver defaults to 100/FULL > +- interrupts: interrupt mapping for the davinci emac interrupts sources: > + 4 sources: <Receive Threshold Interrupt > + Receive Interrupt > + Transmit Interrupt > + Miscellaneous Interrupt> > +- pinmux-handle: Contains a handle to configure the pinmux settings. > + > +Optional properties: > +- local-mac-address : 6 bytes, mac address > + > +Example (enbw_cmc board): > + eth0: emac@1e20000 { > + compatible = "ti,davinci-dm6460-emac"; > + reg = <0x220000 0x4000>; > + ti,davinci-ctrl-reg-offset = <0x3000>; > + ti,davinci-ctrl-mod-reg-offset = <0x2000>; > + ti,davinci-ctrl-ram-offset = <0>; > + ti,davinci-ctrl-ram-size = <0x2000>; > + local-mac-address = [ 00 00 00 00 00 00 ]; > + interrupts = <33 > + 34 > + 35 > + 36 > + >; > + interrupt-parent = <&intc>; > + pinmux-handle = <&emac_pins>; > + }; > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c > index 4fa0bcb..56e1c35 100644 > --- a/drivers/net/ethernet/ti/davinci_emac.c > +++ b/drivers/net/ethernet/ti/davinci_emac.c > @@ -58,6 +58,12 @@ > #include <linux/io.h> > #include <linux/uaccess.h> > #include <linux/davinci_emac.h> > +#include <linux/of.h> > +#include <linux/of_address.h> > +#include <linux/of_irq.h> > +#include <linux/of_net.h> > + > +#include <mach/mux.h> > > #include <asm/irq.h> > #include <asm/page.h> > @@ -339,6 +345,9 @@ struct emac_priv { > u32 rx_addr_type; > atomic_t cur_tx; > const char *phy_id; > +#ifdef CONFIG_OF > + struct device_node *phy_node; > +#endif > struct phy_device *phydev; > spinlock_t lock; > /*platform specific members*/ > @@ -1760,6 +1769,82 @@ static const struct net_device_ops emac_netdev_ops = { > #endif > }; > > +#ifdef CONFIG_OF > +static struct emac_platform_data > + *davinci_emac_of_get_pdata(struct platform_device *pdev, > + struct emac_priv *priv) > +{ > + struct device_node *np; > + struct device_node *pinmux_np; > + struct emac_platform_data *pdata = NULL; > + const u8 *mac_addr; > + u32 data; > + int ret; > + int version; > + > + np = pdev->dev.of_node; > + if (!np) > + goto nodata; > + else > + version = EMAC_VERSION_2; You could set pdata->version directly here. > + > + pdata = pdev->dev.platform_data; > + if (!pdata) { > + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); > + if (!pdata) > + goto nodata; > + } > + pdata->version = version; > + > + mac_addr = of_get_mac_address(np); > + if (mac_addr) > + memcpy(pdata->mac_addr, mac_addr, ETH_ALEN); > + > + ret = of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &data); > + if (!ret) > + pdata->ctrl_reg_offset = data; > + > + ret = of_property_read_u32(np, "ti,davinci-ctrl-mod-reg-offset", > + &data); > + if (!ret) > + pdata->ctrl_mod_reg_offset = data; > + > + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-offset", &data); > + if (!ret) > + pdata->ctrl_ram_offset = data; > + > + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-size", &data); > + if (!ret) > + pdata->ctrl_ram_size = data; > + > + ret = of_property_read_u32(np, "ti,davinci-rmii-en", &data); > + if (!ret) > + pdata->rmii_en = data; > + > + ret = of_property_read_u32(np, "ti,davinci-no-bd-ram", &data); > + if (!ret) > + pdata->no_bd_ram = data; > + > + priv->phy_node = of_parse_phandle(np, "phy-handle", 0); > + if (!priv->phy_node) > + pdata->phy_id = ""; > + > + pinmux_np = of_parse_phandle(np, "pinmux-handle", 0); > + if (pinmux_np) > + davinci_cfg_reg_of(pinmux_np); This is a DaVinci specific pinmux function and this driver can be used in non-DaVinci platforms like C6x and OMAP. So, it will not be correct to call a DaVinci specific function here. Can you drop the pinmux from this patch for now? On DaVinci, for pinmux, we need to migrate to drivers/pinctrl/ as well. Doing this will also make this patch independent of the rest of this series can even be merged separately. Can you please make these changes and resend just this patch? > + > + pdev->dev.platform_data = pdata; > +nodata: > + return pdata; > +} > +#else > +static struct emac_platform_data > + *davinci_emac_of_get_pdata(struct platform_device *pdev, > + struct emac_priv *priv) > +{ > + return pdev->dev.platform_data; > +} > +#endif > /** > * davinci_emac_probe: EMAC device probe > * @pdev: The DaVinci EMAC device that we are removing > @@ -1803,7 +1888,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) > > spin_lock_init(&priv->lock); > > - pdata = pdev->dev.platform_data; > + pdata = davinci_emac_of_get_pdata(pdev, priv); > if (!pdata) { > dev_err(&pdev->dev, "no platform data\n"); > rc = -ENODEV; > @@ -2013,6 +2098,12 @@ static const struct dev_pm_ops davinci_emac_pm_ops = { > .resume = davinci_emac_resume, > }; > > +static const struct of_device_id davinci_emac_of_match[] = { > + {.compatible = "ti,davinci-dm6460-emac", }, This needs to be ti,davinci-dm6467-emac as well. Thanks, Sekhar ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support 2012-05-15 18:08 ` Nori, Sekhar @ 2012-05-17 6:32 ` Heiko Schocher 2012-05-17 7:21 ` Sekhar Nori 0 siblings, 1 reply; 8+ messages in thread From: Heiko Schocher @ 2012-05-17 6:32 UTC (permalink / raw) To: Nori, Sekhar Cc: davinci-linux-open-source@linux.davincidsp.com, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org, Grant Likely, Wolfgang Denk, Anatoly Sivov Hello Nori, thanks for the review! Nori, Sekhar wrote: > Hi Heiko, > > On Mon, Mar 05, 2012 at 16:40:01, Heiko Schocher wrote: >> add of support for the davinci_emac driver. >> >> Signed-off-by: Heiko Schocher <hs@denx.de> >> Cc: davinci-linux-open-source@linux.davincidsp.com >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: devicetree-discuss@lists.ozlabs.org >> Cc: netdev@vger.kernel.org >> Cc: Grant Likely <grant.likely@secretlab.ca> >> Cc: Sekhar Nori <nsekhar@ti.com> >> Cc: Wolfgang Denk <wd@denx.de> >> Cc: Anatoly Sivov <mm05@mail.ru> >> >> --- >> - changes for v2: >> - add comment from Anatoly Sivov >> - fix typo in davinci_emac.txt >> - add comment from Grant Likely: >> - add prefix "ti,davinci-" to davinci specific property names >> - remove version property >> - use compatible name "ti,davinci-dm6460-emac" >> - use devm_kzalloc() >> - use of_match_ptr() >> - document all new properties >> - remove of_address_to_resource() and do not overwrite >> resource table >> - whitespace fixes >> - remove hw_ram_addr as it is not used in current >> board code >> - no changes for v3 >> >> .../bindings/arm/davinci/davinci_emac.txt | 43 +++++++++ >> drivers/net/ethernet/ti/davinci_emac.c | 94 +++++++++++++++++++- >> 2 files changed, 136 insertions(+), 1 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt >> >> diff --git a/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt >> new file mode 100644 >> index 0000000..a7b0911 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/arm/davinci/davinci_emac.txt > > Since DaVinci EMAC driver may be used on platforms other than DaVinci (c6x, > OMAP), can we place the bindings documentation in bindings/net/? Done. >> @@ -0,0 +1,43 @@ >> +* Texas Instruments Davinci EMAC >> + >> +This file provides information, what the device node >> +for the davinci_emac interface contain. > > s/contain/contains fixed. >> + >> +Required properties: >> +- compatible: "ti,davinci-dm6460-emac"; > > There is no device called dm6460. If you intend to only support > "version 2" of the EMAC IP at this time, you can use dm6467 > (http://www.ti.com/product/tms320dm6467) renamed to "ti,davinci-dm6467-emac" >> +- reg: Offset and length of the register set for the device >> +- ti,davinci-ctrl-reg-offset: offset to control register >> +- ti,davinci-ctrl-mod-reg-offset: offset to control module register >> +- ti,davinci-ctrl-ram-offset: offset to control module ram >> +- ti,davinci-ctrl-ram-size: size of control module ram >> +- ti,davinci-rmii-en: use RMII >> +- ti,davinci-no-bd-ram: has the emac controller BD RAM >> +- phy-handle: Contains a phandle to an Ethernet PHY. >> + if not, davinci_emac driver defaults to 100/FULL >> +- interrupts: interrupt mapping for the davinci emac interrupts sources: >> + 4 sources: <Receive Threshold Interrupt >> + Receive Interrupt >> + Transmit Interrupt >> + Miscellaneous Interrupt> >> +- pinmux-handle: Contains a handle to configure the pinmux settings. removed. >> + >> +Optional properties: >> +- local-mac-address : 6 bytes, mac address >> + >> +Example (enbw_cmc board): >> + eth0: emac@1e20000 { >> + compatible = "ti,davinci-dm6460-emac"; >> + reg = <0x220000 0x4000>; >> + ti,davinci-ctrl-reg-offset = <0x3000>; >> + ti,davinci-ctrl-mod-reg-offset = <0x2000>; >> + ti,davinci-ctrl-ram-offset = <0>; >> + ti,davinci-ctrl-ram-size = <0x2000>; >> + local-mac-address = [ 00 00 00 00 00 00 ]; >> + interrupts = <33 >> + 34 >> + 35 >> + 36 >> + >; >> + interrupt-parent = <&intc>; >> + pinmux-handle = <&emac_pins>; removed. >> + }; >> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c >> index 4fa0bcb..56e1c35 100644 >> --- a/drivers/net/ethernet/ti/davinci_emac.c >> +++ b/drivers/net/ethernet/ti/davinci_emac.c >> @@ -58,6 +58,12 @@ >> #include <linux/io.h> >> #include <linux/uaccess.h> >> #include <linux/davinci_emac.h> >> +#include <linux/of.h> >> +#include <linux/of_address.h> >> +#include <linux/of_irq.h> >> +#include <linux/of_net.h> >> + >> +#include <mach/mux.h> >> >> #include <asm/irq.h> >> #include <asm/page.h> >> @@ -339,6 +345,9 @@ struct emac_priv { >> u32 rx_addr_type; >> atomic_t cur_tx; >> const char *phy_id; >> +#ifdef CONFIG_OF >> + struct device_node *phy_node; >> +#endif >> struct phy_device *phydev; >> spinlock_t lock; >> /*platform specific members*/ >> @@ -1760,6 +1769,82 @@ static const struct net_device_ops emac_netdev_ops = { >> #endif >> }; >> >> +#ifdef CONFIG_OF >> +static struct emac_platform_data >> + *davinci_emac_of_get_pdata(struct platform_device *pdev, >> + struct emac_priv *priv) >> +{ >> + struct device_node *np; >> + struct device_node *pinmux_np; >> + struct emac_platform_data *pdata = NULL; >> + const u8 *mac_addr; >> + u32 data; >> + int ret; >> + int version; >> + >> + np = pdev->dev.of_node; >> + if (!np) >> + goto nodata; >> + else >> + version = EMAC_VERSION_2; > > You could set pdata->version directly here. done. >> + >> + pdata = pdev->dev.platform_data; >> + if (!pdata) { >> + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); >> + if (!pdata) >> + goto nodata; >> + } >> + pdata->version = version; >> + >> + mac_addr = of_get_mac_address(np); >> + if (mac_addr) >> + memcpy(pdata->mac_addr, mac_addr, ETH_ALEN); >> + >> + ret = of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &data); >> + if (!ret) >> + pdata->ctrl_reg_offset = data; >> + >> + ret = of_property_read_u32(np, "ti,davinci-ctrl-mod-reg-offset", >> + &data); >> + if (!ret) >> + pdata->ctrl_mod_reg_offset = data; >> + >> + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-offset", &data); >> + if (!ret) >> + pdata->ctrl_ram_offset = data; >> + >> + ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-size", &data); >> + if (!ret) >> + pdata->ctrl_ram_size = data; >> + >> + ret = of_property_read_u32(np, "ti,davinci-rmii-en", &data); >> + if (!ret) >> + pdata->rmii_en = data; >> + >> + ret = of_property_read_u32(np, "ti,davinci-no-bd-ram", &data); >> + if (!ret) >> + pdata->no_bd_ram = data; >> + >> + priv->phy_node = of_parse_phandle(np, "phy-handle", 0); >> + if (!priv->phy_node) >> + pdata->phy_id = ""; >> + >> + pinmux_np = of_parse_phandle(np, "pinmux-handle", 0); >> + if (pinmux_np) >> + davinci_cfg_reg_of(pinmux_np); > > This is a DaVinci specific pinmux function and this > driver can be used in non-DaVinci platforms like C6x > and OMAP. So, it will not be correct to call a DaVinci > specific function here. Ah, right! > Can you drop the pinmux from this patch for now? On DaVinci, Done ... Hmm.. so I think, I should drop this for all patches from my patchset, right? > for pinmux, we need to migrate to drivers/pinctrl/ as well. Ah, I see ... take a look at it, maybe I find time to do here something ... or do you know about work in progress here? > Doing this will also make this patch independent of the rest > of this series can even be merged separately. Can you please > make these changes and resend just this patch? Yep, I do some test with the changes you requested and resend this patch ... do you prefer some tree, which I should use as base? >> + >> + pdev->dev.platform_data = pdata; >> +nodata: >> + return pdata; >> +} >> +#else >> +static struct emac_platform_data >> + *davinci_emac_of_get_pdata(struct platform_device *pdev, >> + struct emac_priv *priv) >> +{ >> + return pdev->dev.platform_data; >> +} >> +#endif >> /** >> * davinci_emac_probe: EMAC device probe >> * @pdev: The DaVinci EMAC device that we are removing >> @@ -1803,7 +1888,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) >> >> spin_lock_init(&priv->lock); >> >> - pdata = pdev->dev.platform_data; >> + pdata = davinci_emac_of_get_pdata(pdev, priv); >> if (!pdata) { >> dev_err(&pdev->dev, "no platform data\n"); >> rc = -ENODEV; >> @@ -2013,6 +2098,12 @@ static const struct dev_pm_ops davinci_emac_pm_ops = { >> .resume = davinci_emac_resume, >> }; >> >> +static const struct of_device_id davinci_emac_of_match[] = { >> + {.compatible = "ti,davinci-dm6460-emac", }, > > This needs to be ti,davinci-dm6467-emac as well. Yep, fixed. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support 2012-05-17 6:32 ` Heiko Schocher @ 2012-05-17 7:21 ` Sekhar Nori 0 siblings, 0 replies; 8+ messages in thread From: Sekhar Nori @ 2012-05-17 7:21 UTC (permalink / raw) To: hs Cc: davinci-linux-open-source@linux.davincidsp.com, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org, Grant Likely, Wolfgang Denk, Anatoly Sivov On 5/17/2012 12:02 PM, Heiko Schocher wrote: > Nori, Sekhar wrote: >> On Mon, Mar 05, 2012 at 16:40:01, Heiko Schocher wrote: >>> +#ifdef CONFIG_OF >>> +static struct emac_platform_data >>> + *davinci_emac_of_get_pdata(struct platform_device *pdev, >>> + struct emac_priv *priv) >>> +{ >>> + struct device_node *np; >>> + struct device_node *pinmux_np; >>> + struct emac_platform_data *pdata = NULL; >>> + const u8 *mac_addr; >>> + u32 data; >>> + int ret; >>> + int version; >>> + >>> + np = pdev->dev.of_node; >>> + if (!np) >>> + goto nodata; >>> + else >>> + version = EMAC_VERSION_2; >> >> You could set pdata->version directly here. > > done. Just noticed that pdata is not setup at this time. I guess you will be moving around some code to do this. >>> + >>> + pinmux_np = of_parse_phandle(np, "pinmux-handle", 0); >>> + if (pinmux_np) >>> + davinci_cfg_reg_of(pinmux_np); >> >> This is a DaVinci specific pinmux function and this >> driver can be used in non-DaVinci platforms like C6x >> and OMAP. So, it will not be correct to call a DaVinci >> specific function here. > > Ah, right! > >> Can you drop the pinmux from this patch for now? On DaVinci, > > Done ... Hmm.. so I think, I should drop this for all patches > from my patchset, right? Yes. > >> for pinmux, we need to migrate to drivers/pinctrl/ as well. > > Ah, I see ... take a look at it, maybe I find time to do here > something ... or do you know about work in progress here? There is no work in progress within TI. So, if you are interested in taking a stab it it, it will be great. > >> Doing this will also make this patch independent of the rest >> of this series can even be merged separately. Can you please >> make these changes and resend just this patch? > > Yep, I do some test with the changes you requested and resend > this patch ... do you prefer some tree, which I should use as > base? This one should ideally merge through the network subsystem so may be base it on the net-next tree? http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=summary Thanks, Sekhar ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org>]
* [PATCH v3 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board [not found] ` <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org> @ 2012-03-05 11:10 ` Heiko Schocher 2012-05-04 15:33 ` [PATCH v3 0/7] " Heiko Schocher 1 sibling, 0 replies; 8+ messages in thread From: Heiko Schocher @ 2012-03-05 11:10 UTC (permalink / raw) To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/ Cc: Heiko Schocher, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-i2c-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, David Woodhouse, Ben Dooks, Wolfram Sang, Sekhar Nori, Kevin Hilman, Wolfgang Denk, Scott Wood, Sylwester Nawrocki - 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 <hs-ynQEQJNshbs@public.gmane.org> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Cc: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org> Cc: Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org> Cc: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org> Cc: Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> --- - 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 0000000..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 <hs-ynQEQJNshbs@public.gmane.org> + * + * 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 = ð0; + }; + + arm { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xfffee000 0x00020000>; + intc: interrupt-controller@1 { + compatible = "ti,cp_intc"; + interrupt-controller; + #interrupt-cells = <1>; + ti,intc-size = <101>; + reg = <0x0 0x2000>; + }; + }; + soc@1c00000 { + compatible = "ti,da850"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x01c00000 0x400000>; + + serial0: serial@1c42000 { + compatible = "ti,da850", "ns16550a"; + reg = <0x42000 0x100>; + clock-frequency = <150000000>; + reg-shift = <2>; + interrupts = <25>; + interrupt-parent = <&intc>; + }; + serial1: serial@1d0c000 { + compatible = "ti,da850", "ns16550a"; + reg = <0x10c000 0x100>; + clock-frequency = <150000000>; + reg-shift = <2>; + interrupts = <53>; + interrupt-parent = <&intc>; + }; + serial2: serial@1d0d000 { + compatible = "ti,da850", "ns16550a"; + reg = <0x10d000 0x100>; + clock-frequency = <150000000>; + reg-shift = <2>; + interrupts = <61>; + interrupt-parent = <&intc>; + }; + + nor_pins: nor_pinmux@1c14120 { + compatible = "ti,davinci-pinmux"; + reg = <0x14120 0x1000>; + pins = < /* muxreg maskoff modemsk muxmode */ + 5 24 15 1 /* EMA_BA_1 */ + 6 0 15 1 /* EMA CLK */ + 6 24 15 1 /* EMA_WAIT_1 */ + 7 0 15 1 /* NEMA_CS_2 */ + 7 16 15 1 /* NEMA_WE */ + 7 20 15 1 /* NEMA_OE */ + 9 28 15 1 /* EMA_D_0 */ + 9 24 15 1 /* EMA_D_1 */ + 9 20 15 1 /* EMA_D_2 */ + 9 16 15 1 /* EMA_D_3 */ + 9 12 15 1 /* EMA_D_4 */ + 9 8 15 1 /* EMA_D_5 */ + 9 4 15 1 /* EMA_D_6 */ + 9 0 15 1 /* EMA_D_7 */ + 8 28 15 1 /* EMA_D_8 */ + 8 24 15 1 /* EMA_D_9 */ + 8 20 15 1 /* EMA_D_10 */ + 8 16 15 1 /* EMA_D_11 */ + 8 12 15 1 /* EMA_D_12 */ + 8 8 15 1 /* EMA_D_13 */ + 8 4 15 1 /* EMA_D_14 */ + 8 0 15 1 /* EMA_D_15 */ + 12 28 15 1 /* EMA_A_0 */ + 12 24 15 1 /* EMA_A_1 */ + 12 20 15 1 /* EMA_A_2 */ + 12 16 15 1 /* EMA_A_3 */ + 12 12 15 1 /* EMA_A_4 */ + 12 8 15 1 /* EMA_A_5 */ + 12 4 15 1 /* EMA_A_6 */ + 12 0 15 1 /* EMA_A_7 */ + 11 28 15 1 /* EMA_A_8 */ + 11 24 15 1 /* EMA_A_9 */ + 11 20 15 1 /* EMA_A_10 */ + 11 16 15 1 /* EMA_A_11 */ + 11 12 15 1 /* EMA_A_12 */ + 11 8 15 1 /* EMA_A_13 */ + 11 4 15 1 /* EMA_A_14 */ + 11 0 15 1 /* EMA_A_15 */ + 10 28 15 1 /* EMA_A_16 */ + 10 24 15 1 /* EMA_A_17 */ + 10 20 15 1 /* EMA_A_18 */ + 10 16 15 1 /* EMA_A_19 */ + 10 12 15 1 /* EMA_A_20 */ + 10 8 15 1 /* EMA_A_21 */ + 10 4 15 1 /* EMA_A_22 */ + 10 0 15 1 /* EMA_A_23 */ + >; + }; + nand_pins: nand_pinmux@1c14120 { + compatible = "ti,davinci-pinmux"; + reg = <0x14120 0x1000>; + pins = < /* muxreg maskoff modemsk muxmode */ + 7 4 15 1 /* NEMA_CS_3 */ + >; + }; + + emac_pins: pinmux@1c14120 { + compatible = "ti,davinci-pinmux"; + reg = <0x14120 0x1000>; + pins = < /* muxreg maskoff modemsk muxmode */ + 2 4 15 8 /* MII TXEN */ + 2 8 15 8 /* MII TXCLK */ + 2 12 15 8 /* MII COL */ + 2 16 15 8 /* MII TXD_3 */ + 2 20 15 8 /* MII TXD_2 */ + 2 24 15 8 /* MII TXD_1 */ + 2 28 15 8 /* MII TXD_0 */ + 3 8 15 8 /* MII RXER */ + 3 12 15 8 /* MII CRS */ + 3 0 15 8 /* MII RXCLK */ + 3 4 15 8 /* MII RXDV */ + 3 16 15 8 /* MII RXD_3 */ + 3 20 15 8 /* MII RXD_2 */ + 3 24 15 8 /* MII RXD_1 */ + 3 28 15 8 /* MII RXD_0 */ + 4 0 15 8 /* MDIO CLK */ + 4 4 15 8 /* MDIO D */ + >; + }; + + i2c1_pins: i2c_pinmux@1c14120 { + compatible = "ti,davinci-pinmux"; + reg = <0x14120 0x1000>; + pins = < /* muxreg maskoff modemsk muxmode */ + 4 12 15 2 /* I2C0 SDA */ + 4 8 15 2 /* I2C0 SCL */ + >; + }; + + eth0: emac@1e20000 { + compatible = "ti,davinci-dm6460-emac"; + reg = <0x220000 0x4000>; + ti,davinci-ctrl-reg-offset = <0x3000>; + ti,davinci-ctrl-mod-reg-offset = <0x2000>; + ti,davinci-ctrl-ram-offset = <0>; + ti,davinci-ctrl-ram-size = <0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <33 + 34 + 35 + 36 + >; + interrupt-parent = <&intc>; + pinmux-handle = <&emac_pins>; + }; + + i2c@1c22000 { + compatible = "ti,davinci-i2c"; + reg = <0x22000 0x1000>; + clock-frequency = <100000>; + interrupts = <15>; + interrupt-parent = <&intc>; + pinmux-handle = <&i2c1_pins>; + #address-cells = <1>; + #size-cells = <0>; + + dtt@48 { + compatible = "national,lm75"; + reg = <0x48>; + }; + }; + }; + onchipram@8000000 { + compatible = "ti,davinci-onchipram"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x80000000 0x20000>; + }; + aemif@60000000 { + compatible = "ti,davinci-aemif"; + #address-cells = <2>; + #size-cells = <1>; + reg = <0x68000000 0x80000>; + ranges = <2 0 0x60000000 0x02000000 + 3 0 0x62000000 0x02000000 + 4 0 0x64000000 0x02000000 + 5 0 0x66000000 0x02000000 + 6 0 0x68000000 0x02000000>; + cs2@68000000 { + compatible = "ti,davinci-cs"; + #address-cells = <1>; + #size-cells = <1>; + /* all timings in nanoseconds */ + cs = <2>; + asize = <1>; + ta = <0>; + rhold = <7>; + rstrobe = <42>; + rsetup = <14>; + whold = <7>; + wstrobe = <42>; + wsetup = <14>; + ew = <0>; + ss = <0>; + }; + flash@2,0 { + compatible = "cfi-flash"; + reg = <2 0x0 0x400000>; + #address-cells = <1>; + #size-cells = <1>; + bank-width = <2>; + device-width = <2>; + }; + nand_cs: cs3@68000000 { + compatible = "ti,davinci-cs"; + #address-cells = <1>; + #size-cells = <1>; + /* all timings in nanoseconds */ + cs = <3>; + asize = <0>; + ta = <0>; + rhold = <7>; + rstrobe = <42>; + rsetup = <7>; + whold = <7>; + wstrobe = <14>; + wsetup = <7>; + ew = <0>; + ss = <0>; + }; + nand@3,0 { + compatible = "ti,davinci-nand"; + reg = <3 0x0 0x807ff + 6 0x0 0x8000>; + #address-cells = <1>; + #size-cells = <1>; + ti,davinci-chipselect = <1>; + ti,davinci-mask-ale = <0>; + ti,davinci-mask-cle = <0>; + ti,davinci-mask-chipsel = <0>; + ti,davinci-ecc-mode = "hw"; + ti,davinci-ecc-bits = <4>; + ti,davinci-nand-use-bbt; + pinmux-handle = <&nand_pins>; + timing-handle = <&nand_cs>; + }; + + }; +}; diff --git a/arch/arm/configs/enbw_cmc_defconfig b/arch/arm/configs/enbw_cmc_defconfig new file mode 100644 index 0000000..9d98e7f --- /dev/null +++ b/arch/arm/configs/enbw_cmc_defconfig @@ -0,0 +1,123 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_BLK_DEV_INITRD=y +CONFIG_EXPERT=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MODVERSIONS=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_ARCH_DAVINCI=y +CONFIG_ARCH_DAVINCI_DA850=y +# CONFIG_MACH_DAVINCI_DA850_EVM is not set +CONFIG_GPIO_PCA953X=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_PREEMPT=y +CONFIG_AEABI=y +# CONFIG_OABI_COMPAT is not set +CONFIG_USE_OF=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_INET_LRO is not set +CONFIG_IPV6=y +CONFIG_NETFILTER=y +# CONFIG_WIRELESS is not set +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_FW_LOADER is not set +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_DAVINCI=y +CONFIG_MTD_UBI=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=1 +CONFIG_BLK_DEV_RAM_SIZE=32768 +CONFIG_EEPROM_AT24=y +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_NETDEVICES=y +CONFIG_MII=y +CONFIG_TI_DAVINCI_EMAC=y +# CONFIG_WLAN is not set +CONFIG_INPUT_POLLDEV=y +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_EVBUG=y +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=3 +CONFIG_SERIAL_8250_RUNTIME_UARTS=3 +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_HW_RANDOM=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_DAVINCI=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_PCF857X=y +CONFIG_SENSORS_LM75=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_CORE=y +CONFIG_DAVINCI_WATCHDOG=y +# CONFIG_HID_SUPPORT is not set +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_MUSB_HDRC=y +CONFIG_USB_MUSB_DA8XX=y +CONFIG_USB_STORAGE=y +CONFIG_USB_UAS=y +CONFIG_USB_LIBUSUAL=y +CONFIG_USB_GADGET=y +CONFIG_USB_FUSB300=y +CONFIG_USB_ETH=y +CONFIG_MMC=y +CONFIG_MMC_DAVINCI=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_OMAP=y +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +CONFIG_AUTOFS4_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_UBIFS_FS=y +CONFIG_CRAMFS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_UTF8=y +CONFIG_DEBUG_FS=y +CONFIG_TIMER_STATS=y +CONFIG_DEBUG_RT_MUTEXES=y +CONFIG_DEBUG_MUTEXES=y +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_CCITT=m +CONFIG_CRC_T10DIF=m diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 32d837d..4cb0469 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -202,6 +202,15 @@ config DA850_WL12XX Say Y if you want to use a wl1271 expansion card connected to the AM18x EVM. +config MACH_ENBW_CMC + bool "EnBW Communication Module Compact" + default ARCH_DAVINCI_DA850 + depends on ARCH_DAVINCI_DA850 + select OF + help + Say Y here to select the EnBW Communication Module Compact + board. + config GPIO_PCA953X default MACH_DAVINCI_DA850_EVM diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 2db78bd..12f3166 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -34,6 +34,7 @@ obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o +obj-$(CONFIG_MACH_ENBW_CMC) += board-enbw-cmc.o # Power Management obj-$(CONFIG_CPU_FREQ) += cpufreq.o 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 0000000..8cb60fb --- /dev/null +++ b/arch/arm/mach-davinci/board-enbw-cmc.c @@ -0,0 +1,380 @@ +/* + * EnBW Communication Module Compact board + * Copyright 2011 DENX Software Engineering GmbH + * Author: Heiko Schocher <hs-ynQEQJNshbs@public.gmane.org> + * + * based on: + * TI DA850/OMAP-L138 EVM board + * + * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ + * + * Derived from: arch/arm/mach-davinci/board-da850-evm.c + * Original Copyrights follow: + * + * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + */ +#include <linux/console.h> +#include <linux/gpio.h> +#include <linux/gpio_keys.h> +#include <linux/i2c.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/nand.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> +#include <linux/of.h> +#include <linux/of_net.h> +#include <linux/of_address.h> +#include <linux/of_platform.h> +#include <linux/phy.h> +#include <linux/phy_fixed.h> +#include <linux/platform_device.h> +#include <linux/spi/spi.h> +#include <linux/spi/flash.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <mach/aemif.h> +#include <mach/cp_intc.h> +#include <mach/da8xx.h> +#include <mach/mux.h> +#include <mach/nand.h> +#include <mach/spi.h> + +#define ENBW_CMC_MMCSD_CD_PIN GPIO_TO_PIN(3, 13) + +/* + * USB1 VBUS is controlled by GPIO7[12], over-current is reported on GPIO7[8]. + */ +#define DA850_USB_VBUS_PIN GPIO_TO_PIN(7, 12) +#define ON_BD_USB_OVC GPIO_TO_PIN(7, 8) + +#if defined(CONFIG_USB_OHCI_HCD) +static irqreturn_t enbw_cmc_usb_ocic_irq(int irq, void *dev_id); +static da8xx_ocic_handler_t enbw_cmc_usb_ocic_handler; + +static int enbw_cmc_usb_set_power(unsigned port, int on) +{ + gpio_set_value(DA850_USB_VBUS_PIN, on); + return 0; +} + +static int enbw_cmc_usb_get_power(unsigned port) +{ + return gpio_get_value(DA850_USB_VBUS_PIN); +} + +static int enbw_cmc_usb_get_oci(unsigned port) +{ + return !gpio_get_value(ON_BD_USB_OVC); +} + +static irqreturn_t enbw_cmc_usb_ocic_irq(int, void *); + +static int enbw_cmc_usb_ocic_notify(da8xx_ocic_handler_t handler) +{ + int irq = gpio_to_irq(ON_BD_USB_OVC); + int error = 0; + + if (handler != NULL) { + enbw_cmc_usb_ocic_handler = handler; + + error = request_irq(irq, enbw_cmc_usb_ocic_irq, + IRQF_DISABLED | IRQF_TRIGGER_RISING | + IRQF_TRIGGER_FALLING, + "OHCI over-current indicator", NULL); + if (error) + pr_err("%s: could not request IRQ to watch " + "over-current indicator changes\n", __func__); + } else { + free_irq(irq, NULL); + } + return error; +} + +static struct da8xx_ohci_root_hub enbw_cmc_usb11_pdata = { + .set_power = enbw_cmc_usb_set_power, + .get_power = enbw_cmc_usb_get_power, + .get_oci = enbw_cmc_usb_get_oci, + .ocic_notify = enbw_cmc_usb_ocic_notify, + .potpgt = (10 + 1) / 2, /* 10 ms max */ +}; + +static irqreturn_t enbw_cmc_usb_ocic_irq(int irq, void *dev_id) +{ + enbw_cmc_usb_ocic_handler(&enbw_cmc_usb11_pdata, 1); + return IRQ_HANDLED; +} +#endif + +static __init void enbw_cmc_usb_init(void) +{ + int ret; + u32 cfgchip2; + + /* Set up USB clock/mode in the CFGCHIP2 register. */ + cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); + + /* USB2.0 PHY reference clock is AUXCLK with 24MHz */ + cfgchip2 &= ~CFGCHIP2_REFFREQ; + cfgchip2 |= CFGCHIP2_REFFREQ_24MHZ; + + /* + * Select internal reference clock for USB 2.0 PHY + * and use it as a clock source for USB 1.1 PHY + * (this is the default setting anyway). + */ + cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX; + cfgchip2 |= CFGCHIP2_USB2PHYCLKMUX; + + cfgchip2 &= ~CFGCHIP2_OTGMODE; + cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN; + + __raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); + + ret = davinci_cfg_reg(DA830_USB0_DRVVBUS); + if (ret) + pr_warning("%s: USB 2.0 PinMux setup failed: %d\n", + __func__, ret); + else { + /* + * SP2525A @ 5V supplies 500mA, + * with the power on to power good time of 10 ms. + */ + ret = da8xx_register_usb20(500, 10); + if (ret) + pr_warning("%s: USB 2.0 registration failed: %d\n", + __func__, ret); + } + +#if defined(CONFIG_USB_OHCI_HCD) + ret = gpio_request_one(DA850_USB_VBUS_PIN, + GPIOF_DIR_OUT, "USB 1.1 VBUS"); + if (ret < 0) { + pr_err("%s: failed to request GPIO for USB 1.1 port " + "power control: %d\n", __func__, ret); + return; + } + gpio_direction_input(DA850_USB_VBUS_PIN); + + ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC"); + if (ret) { + printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " + "over-current indicator: %d\n", __func__, ret); + gpio_free(DA850_USB_VBUS_PIN); + return; + } + gpio_direction_input(ON_BD_USB_OVC); + + ret = da8xx_register_usb11(&enbw_cmc_usb11_pdata); + if (ret) { + pr_warning("%s: USB 1.1 registration failed: %d\n", + __func__, ret); + gpio_free(ON_BD_USB_OVC); + gpio_free(DA850_USB_VBUS_PIN); + } +#endif + + return; +} + +static int enbw_cmc_mmc_get_ro(int index) +{ + return 0; +} + +static int enbw_cmc_mmc_get_cd(int index) +{ + return gpio_get_value(ENBW_CMC_MMCSD_CD_PIN) ? 1 : 0; +} + +static struct davinci_mmc_config enbw_cmc_mmc_config = { + .get_ro = enbw_cmc_mmc_get_ro, + .get_cd = enbw_cmc_mmc_get_cd, + .wires = 4, + .max_freq = 50000000, + .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, + .version = MMC_CTLR_VERSION_2, +}; + +static int __init enbw_cmc_config_emac(void) +{ + void __iomem *cfg_chip3_base; + u32 val; + struct davinci_soc_info *soc_info = &davinci_soc_info; + + if (!machine_is_enbw_cmc()) + return 0; + + cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); + val = __raw_readl(cfg_chip3_base); + val &= ~BIT(8); + pr_info("EMAC: MII PHY configured, RMII PHY will not be" + " functional\n"); + + /* configure the CFGCHIP3 register for MII */ + __raw_writel(val, cfg_chip3_base); + + /* use complete info from OF */ + soc_info->emac_pdata = NULL; + + return 0; +} +device_initcall(enbw_cmc_config_emac); + +static const s16 da850_dma0_rsv_chans[][2] = { + /* (offset, number) */ + {-1, -1} +}; + +static const s16 da850_dma0_rsv_slots[][2] = { + /* (offset, number) */ + {-1, -1} +}; + +static const s16 da850_dma1_rsv_chans[][2] = { + /* (offset, number) */ + {-1, -1} +}; + +static const s16 da850_dma1_rsv_slots[][2] = { + /* (offset, number) */ + {-1, -1} +}; + +static struct edma_rsv_info da850_edma_cc0_rsv = { + .rsv_chans = da850_dma0_rsv_chans, + .rsv_slots = da850_dma0_rsv_slots, +}; + +static struct edma_rsv_info da850_edma_cc1_rsv = { + .rsv_chans = da850_dma1_rsv_chans, + .rsv_slots = da850_dma1_rsv_slots, +}; + +static struct edma_rsv_info *da850_edma_rsv[2] = { + &da850_edma_cc0_rsv, + &da850_edma_cc1_rsv, +}; + +#ifdef CONFIG_CPU_FREQ +static __init int da850_evm_init_cpufreq(void) +{ + switch (system_rev & 0xF) { + case 3: + da850_max_speed = 456000; + break; + case 2: + da850_max_speed = 408000; + break; + case 1: + da850_max_speed = 372000; + break; + } + + return da850_register_cpufreq("pll0_sysclk3"); +} +#else +static __init int da850_evm_init_cpufreq(void) { return 0; } +#endif + +struct of_dev_auxdata enbw_cmc_auxdata_lookup[] __initdata = { + OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "ti,davinci-wdt", NULL), + OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), + OF_DEV_AUXDATA("ti,davinci-i2c", 0x01e28000, "i2c_davinci.2", NULL), + OF_DEV_AUXDATA("ti,davinci-dm6460-emac", 0x01e20000, "davinci_emac.1", + NULL), + {} +}; + +const struct of_device_id enbw_cmc_bus_match_table[] = { + { .compatible = "simple-bus", }, + { .compatible = "ti,da850", }, + { .compatible = "ti,davinci-onchipram", }, + { .compatible = "ti,davinci-aemif", }, + {} /* Empty terminated list */ +}; + +static __init void enbw_cmc_init(void) +{ + int ret; + + of_platform_populate(NULL, enbw_cmc_bus_match_table, + enbw_cmc_auxdata_lookup, NULL); + + ret = da8xx_register_watchdog(); + if (ret) + pr_warning("enbw_cmc_init: watchdog registration failed: %d\n", + ret); + + ret = da850_register_edma(da850_edma_rsv); + if (ret) + pr_warning("enbw_cmc_init: edma registration failed: %d\n", + ret); + + /* + * shut down uart 0 this port is not used on the board + */ + __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); + + ret = da8xx_register_rtc(); + if (ret) + pr_warning("enbw_cmc_init: rtc setup failed: %d\n", ret); + + ret = da850_evm_init_cpufreq(); + if (ret) + pr_warning("enbw_cmc_init: cpufreq registration failed: %d\n", + ret); + + ret = da8xx_register_cpuidle(); + if (ret) + pr_warning("enbw_cmc_init: cpuidle registration failed: %d\n", + ret); + + ret = gpio_request(ENBW_CMC_MMCSD_CD_PIN, "MMC CD\n"); + if (ret) + pr_warning("enbw_cmc_init: can not open GPIO %d\n", + ENBW_CMC_MMCSD_CD_PIN); + gpio_direction_input(ENBW_CMC_MMCSD_CD_PIN); + + ret = da850_register_mmcsd1(&enbw_cmc_mmc_config); + if (ret) + pr_warning("enbw_cmc_init: mmcsd1 registration failed:" + " %d\n", ret); + + enbw_cmc_usb_init(); +} + +#ifdef CONFIG_SERIAL_8250_CONSOLE +static int __init enbw_cmc_console_init(void) +{ + if (!machine_is_enbw_cmc()) + return 0; + + return add_preferred_console("ttyS", 2, "115200"); +} +console_initcall(enbw_cmc_console_init); +#endif + +static void __init enbw_cmc_map_io(void) +{ + da850_init(); +} + +static const char *enbw_cmc_board_compat[] __initconst = { + "enbw,cmc", + NULL +}; + +MACHINE_START(ENBW_CMC, "EnBW CMC") + .map_io = enbw_cmc_map_io, + .init_irq = cp_intc_init, + .timer = &davinci_timer, + .init_machine = enbw_cmc_init, + .dt_compat = enbw_cmc_board_compat, + .dma_zone_size = SZ_128M, + .restart = da8xx_restart, +MACHINE_END diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 9dc7cf9..2f21384 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h @@ -96,6 +96,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id) DEBUG_LL_DA8XX(davinci_da850_evm, 2); DEBUG_LL_DA8XX(mityomapl138, 1); DEBUG_LL_DA8XX(omapl138_hawkboard, 2); + DEBUG_LL_DA8XX(enbw_cmc, 2); /* TNETV107x boards */ DEBUG_LL_TNETV107X(tnetv107x, 1); -- 1.7.7.6 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board [not found] ` <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org> 2012-03-05 11:10 ` [PATCH v3 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher @ 2012-05-04 15:33 ` Heiko Schocher [not found] ` <4FA3F6C2.9010602-ynQEQJNshbs@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Heiko Schocher @ 2012-05-04 15:33 UTC (permalink / raw) To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/ Cc: Kevin Hilman, Wolfgang Denk, Sergei Shtylyov, netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Wolfram Sang, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks, David Woodhouse, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r 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.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> > 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 <hs-ynQEQJNshbs@public.gmane.org> > Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org > Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org > Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> > Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> > Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > Cc: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> > Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org> > Cc: Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org> > Cc: Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org> > > 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/i2c/busses/i2c-davinci.c | 37 ++ > drivers/mtd/nand/davinci_nand.c | 85 +++++- > drivers/net/ethernet/ti/davinci_emac.c | 94 +++++- > 20 files changed, 1569 insertions(+), 14 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 100644 Documentation/devicetree/bindings/arm/davinci/mux.txt > create mode 100644 Documentation/devicetree/bindings/arm/davinci/nand.txt > 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 > -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd-ynQEQJNshbs@public.gmane.org ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <4FA3F6C2.9010602-ynQEQJNshbs@public.gmane.org>]
* Re: [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board [not found] ` <4FA3F6C2.9010602-ynQEQJNshbs@public.gmane.org> @ 2012-05-04 18:36 ` Sekhar Nori 0 siblings, 0 replies; 8+ messages in thread From: Sekhar Nori @ 2012-05-04 18:36 UTC (permalink / raw) To: hs-ynQEQJNshbs Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-i2c-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, David Woodhouse, Ben Dooks, Wolfram Sang, Kevin Hilman, Wolfgang Denk, Sergei Shtylyov, Grant Likely, Rob Herring Hi Heiko, On 5/4/2012 9:03 PM, Heiko Schocher wrote: > Hello, > > this v3 patchset is now pending for more than 1 month without > seeing comments for it. Are there no more issues? I am yet to get to them. I have mostly cleared my backlog and will be looking into these next. Sorry about the delay. > Should I rebase it (if no further comments occur), as it is > pending so long? (If so, against which tree?) The series touches multiple subsystems, so may be each patch will go through individual subsystem maintainer. Also copying Grant and Rob as device tree maintainers. Thanks, Sekhar > > 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.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> >> 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 <hs-ynQEQJNshbs@public.gmane.org> >> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org >> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org >> Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org >> Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org >> Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> >> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> >> Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> >> Cc: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> >> Cc: Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org> >> Cc: Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org> >> Cc: Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org> >> >> 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/i2c/busses/i2c-davinci.c | 37 ++ >> drivers/mtd/nand/davinci_nand.c | 85 +++++- >> drivers/net/ethernet/ti/davinci_emac.c | 94 +++++- >> 20 files changed, 1569 insertions(+), 14 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 100644 Documentation/devicetree/bindings/arm/davinci/mux.txt >> create mode 100644 Documentation/devicetree/bindings/arm/davinci/nand.txt >> 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 >> > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-05-17 7:21 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-03-05 11:09 [PATCH v3 0/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher 2012-03-05 11:10 ` [PATCH v3 4/7] ARM: davinci: net: davinci_emac: add OF support Heiko Schocher 2012-05-15 18:08 ` Nori, Sekhar 2012-05-17 6:32 ` Heiko Schocher 2012-05-17 7:21 ` Sekhar Nori [not found] ` <1330945804-3379-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org> 2012-03-05 11:10 ` [PATCH v3 7/7] ARM: davinci: add support for the am1808 based enbw_cmc board Heiko Schocher 2012-05-04 15:33 ` [PATCH v3 0/7] " Heiko Schocher [not found] ` <4FA3F6C2.9010602-ynQEQJNshbs@public.gmane.org> 2012-05-04 18:36 ` Sekhar Nori
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).