Re: [PATCH 1/3] ARM: dts: Add headers with constants for MTD partitions
Hello, Thank you for the review. On 06/12/2013 03:05 PM, Grant Likely wrote: On Tue, 11 Jun 2013 16:48:56 +0200, Florian Vaussard florian.vauss...@epfl.ch wrote: These constants can be used to easily declare MTD partitions inside DTS. The constants MTDPART_OFS_* are purposely not included. Indeed, parse_ofpart_partitions() is expecting u64, but a DT cell is u32. Negative constants, as defined by MTDPART_OFS_*, would be wrongly The DT binding uses the number of cells defined by #address-cells. It is not fixed to a u32 or a u64 The message was ill-formatted, sorry. As an address cell is u32, and as parse_ofpart_partitions() is storing the value inside u64 without checking for sign extension (as one assumes to have only positive offsets), passing a negative value would require 2 address cells, making it more difficult for the DT user. But as Stephen Warren noticed, it is probably desirable to specify sizes = 4GB, thus I will think about a way to easily handle such case. Anyway, MTDPART_OFS_* would probably face the same objection raised by you for MTDPART_SIZ_FULL. interpreted by parse_ofpart_partitions(). Two cells should be used to correctly encode the negative constants, but this breaks current usage. The binding doesn't even allow for shortcuts like MTDPART_SIZ_FULL. If a partition fills the whole device, then the reg property should include the actual size. If the code is allowing '0' to be used to mean MTDPART_SIZ_FULL, then that is a bug that needs to be fixed. The root problem is that many System on Module, like the Gumstix Overo, are shipped with various NAND sizes depending on the version or even the manufacturing period. Supporting such a diversity would painfully duplicates lots of DT code and clutter the arch/arm/boot/dts/ directory with dozens of slightly- different versions. I believe that determining the NAND size is better done at probe time, and this is what is currently done in legacy board files: static struct mtd_partition overo_nand_partitions[] = { { .name = xloader, .offset = 0,/* Offset = 0x0 */ .size = 4 * NAND_BLOCK_SIZE, .mask_flags = MTD_WRITEABLE }, snip... { .name = rootfs, .offset = MTDPART_OFS_APPEND, /* Offset = 0x68 */ .size = MTDPART_SIZ_FULL, }, }; Moreover, I do not see such strict restriction in the OF norm. If I refer to IEEE 1275-1994 page 174, for the definition of the reg property, it is written: The interpretation of the size entries is dependent on the parent bus. Nevertheless, if such an approach is not acceptable, could we think about an alternative solution? Like a boolean property mtd,append-and-fill that would replace the reg property and tell the MTD core to compute the partition size at probe time, like what is currently done with board files? Best regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH] ARM: dts: Protect pinctrl headers against multiple inclusions
Hello Benoit, On 06/12/2013 06:18 PM, Cousson, Benoit wrote: Hi Florian, On 6/12/2013 8:42 AM, Florian Vaussard wrote: Hello Grant, On 06/11/2013 11:57 PM, Grant Likely wrote: On Tue, 11 Jun 2013 16:50:50 +0200, Florian Vaussard florian.vauss...@epfl.ch wrote: Pinctrl headers were not protected with #ifndef. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Obviously this needs to go in via whatever tree added the modified header files. I authored these files, sorry for this stupid omission. Benoit, can you take this patch? Yes, sure, I'll take it with Grant's ack. I think that you missed this one. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 0/4] ARM: dts: OMAP3: Updates for Overo
Hello Benoit, Any comments on this series? Regards, Florian On 06/11/2013 04:49 PM, Florian Vaussard wrote: Hello, This series performs several updates to omap3-overo and omap3-tobi. Patch 1 is necessary to patch 2 for the IRQ constant. The SMSC911X is largely taken from omap3-igep. Regards, Florian Florian Vaussard (4): ARM: dts: OMAP3: Include IRQ header ARM: dts: omap3-tobi: Add SMSC911X node ARM: dts: omap3-tobi: Correct polarity for GPIO LED ARM: dts: omap3-overo: Add default trigger for TWL4030 LED arch/arm/boot/dts/omap3-overo.dtsi |1 + arch/arm/boot/dts/omap3-tobi.dts | 50 +++- arch/arm/boot/dts/omap3.dtsi |1 + 3 files changed, 51 insertions(+), 1 deletions(-) ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 1/4] ARM: dts: omap4-panda: Add USB Host support
Hello, On 06/19/2013 01:03 PM, Roger Quadros wrote: On 06/19/2013 01:10 PM, Benoit Cousson wrote: On 06/19/2013 02:46 AM, Tony Lindgren wrote: * Roger Quadros rog...@ti.com [130619 00:42]: Hi Benoit, On 06/19/2013 04:17 AM, Benoit Cousson wrote: Hi Roger, On 06/18/2013 11:04 AM, Roger Quadros wrote: Provide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device. Also provide pin multiplexer information for the USB host pins. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4-panda-common.dtsi | 62 + 1 files changed, 62 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index 00cbaa5..7a21e8e 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -59,6 +59,42 @@ AFML, Line In, AFMR, Line In; }; + +/* HS USB Port 1 RESET */ +hsusb1_reset: hsusb1_reset_reg { +compatible = regulator-fixed; +regulator-name = hsusb1_reset; +regulator-min-microvolt = 330; +regulator-max-microvolt = 330; +gpio = gpio2 30 0;/* gpio_62 */ +startup-delay-us = 7; +enable-active-high; +}; Is this really a regulator? Or just a GPIO line used to reset the USB PHY? It is in fact a GPIO line used as reset. If this is the case, I don't think it should be represented as a regulator. Why not? I think it fits very well in the regulator device model. I'm not sure fitting very well is the correct term. It works, for sure, but it is no different than when we were trying to abuse the regulator fmwk to enable the 32k clock in phoenix. It is just a hack. The only difference is there is a dedicated framework for clocks. Since there is nothing specific to handle reset lines it is left to the driver writer how he wants to manage it. There is a proposed binding for gpio-controlled reset lines, but it is not yet merged [1]. I guess it can fit most usage patterns, and it can be an interesting move in the future. Regards, Florian [1] http://thread.gmane.org/gmane.linux.drivers.devicetree/36830 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/3] mfd: twl4030-power: Split from twl-core into a dedicated module
Hello, Thank you for the review. On 06/18/2013 01:56 AM, Samuel Ortiz wrote: Hi Florian, On Thu, May 30, 2013 at 03:51:54PM +0200, Florian Vaussard wrote: For now, the call to twl4030-power is hard-wired inside twl-core. To ease the future transition to DT, make twl4030-power as a separate module, like what is already done for twl4030-audio and others. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl-core.c | 12 ++--- drivers/mfd/twl4030-power.c | 54 +++ include/linux/i2c/twl.h |1 - 3 files changed, 52 insertions(+), 15 deletions(-) Looks good, I only have one comment: +static struct platform_driver twl4030_power_driver = { + .driver = { + .name = twl4030_power, + .owner = THIS_MODULE, + }, + .probe = twl4030_power_probe, + .remove = twl4030_power_remove, +}; + +static int __init twl4030_power_init(void) +{ + return platform_driver_register(twl4030_power_driver); } +subsys_initcall(twl4030_power_init); + +static void __exit twl4030_power_exit(void) +{ + platform_driver_unregister(twl4030_power_driver); +} +module_exit(twl4030_power_exit); Please use module_platform_driver() here. Sure! Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 2/3] mfd: twl4030-power: Start transition to DT
Hello, On 06/18/2013 02:02 AM, Samuel Ortiz wrote: Hi Florian, On Thu, May 30, 2013 at 03:51:55PM +0200, Florian Vaussard wrote: int twl4030_power_probe(struct platform_device *pdev) { struct twl4030_power_data *pdata = pdev-dev.platform_data; + struct device_node *node = pdev-dev.of_node; int err = 0; - int i; - struct twl4030_resconfig *resconfig; - u8 val, address = twl4030_start_script_address; + u8 val; + + if (!pdata !node) { + dev_err(pdev-dev, Platform data is missing\n); + return -EINVAL; + } err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); @@ -525,26 +575,17 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) goto unlock; - for (i = 0; i pdata-num; i++) { - err = load_twl4030_script(pdata-scripts[i], address); + if (pdata) { + err = twl4030_power_configure_scripts(pdata); if (err) goto load; - address += pdata-scripts[i]-size; - } - - resconfig = pdata-resource_config; - if (resconfig) { - while (resconfig-resource) { - err = twl4030_configure_resource(resconfig); - if (err) - goto resource; - resconfig++; - - } + err = twl4030_power_configure_resources(pdata); + if (err) + goto resource; You're simplifying the probe routine here by defining 2 twl4030_power_configure_* functions. That's good, but it should be a separate patch as it's not related to the DT porting effort. I agree. I will post a v2 with the changes. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 1/5] mfd: twl4030-power: Split from twl-core into a dedicated module
For now, the call to twl4030-power is hard-wired inside twl-core. To ease the future transition to DT, make twl4030-power as a separate module, like what is already done for twl4030-audio and others. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl-core.c | 12 +++--- drivers/mfd/twl4030-power.c | 44 +- include/linux/i2c/twl.h |1 - 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 8d9bc10..dbd52b3 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -1023,6 +1023,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, return PTR_ERR(child); } + if (IS_ENABLED(CONFIG_TWL4030_POWER) pdata-power) { + child = add_child(TWL_MODULE_PM_MASTER, twl4030_power, + pdata-power, sizeof(*pdata-power), false, + 0, 0); + if (IS_ERR(child)) + return PTR_ERR(child); + } + return 0; } @@ -1234,10 +1242,6 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) WARN(status 0, Error: reading twl_idcode register value\n); } - /* load power event scripts */ - if (IS_ENABLED(CONFIG_TWL4030_POWER) pdata pdata-power) - twl4030_power_init(pdata-power); - /* Maybe init the T2 Interrupt subsystem */ if (client-irq) { if (twl_class_is_4030()) { diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index dd362c1..7ade81b 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -507,8 +507,9 @@ void twl4030_power_off(void) pr_err(TWL4030 Unable to power off\n); } -void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) +int twl4030_power_probe(struct platform_device *pdev) { + struct twl4030_power_data *pdata = pdev-dev.platform_data; int err = 0; int i; struct twl4030_resconfig *resconfig; @@ -524,14 +525,14 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) if (err) goto unlock; - for (i = 0; i twl4030_scripts-num; i++) { - err = load_twl4030_script(twl4030_scripts-scripts[i], address); + for (i = 0; i pdata-num; i++) { + err = load_twl4030_script(pdata-scripts[i], address); if (err) goto load; - address += twl4030_scripts-scripts[i]-size; + address += pdata-scripts[i]-size; } - resconfig = twl4030_scripts-resource_config; + resconfig = pdata-resource_config; if (resconfig) { while (resconfig-resource) { err = twl4030_configure_resource(resconfig); @@ -543,7 +544,7 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) } /* Board has to be wired properly to use this feature */ - if (twl4030_scripts-use_poweroff !pm_power_off) { + if (pdata-use_poweroff !pm_power_off) { /* Default for SEQ_OFFSYNC is set, lets ensure this */ err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, val, TWL4030_PM_MASTER_CFG_P123_TRANSITION); @@ -568,18 +569,41 @@ relock: TWL4030_PM_MASTER_PROTECT_KEY); if (err) pr_err(TWL4030 Unable to relock registers\n); - return; + return err; unlock: if (err) pr_err(TWL4030 Unable to unlock registers\n); - return; + return err; load: if (err) pr_err(TWL4030 failed to load scripts\n); - return; + return err; resource: if (err) pr_err(TWL4030 failed to configure resource\n); - return; + return err; } + +static int twl4030_power_remove(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver twl4030_power_driver = { + .driver = { + .name = twl4030_power, + .owner = THIS_MODULE, + }, + .probe = twl4030_power_probe, + .remove = twl4030_power_remove, +}; + +module_platform_driver(twl4030_power_driver); + +MODULE_AUTHOR(Nokia Corporation); +MODULE_AUTHOR(Texas Instruments, Inc.); +MODULE_DESCRIPTION(Power management for TWL4030); +MODULE_LICENSE(GPL); +MODULE_ALIAS(platform:twl4030_power); + diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 488debb..2167c0d0 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -658,7 +658,6 @@ struct twl4030_power_data { bool use_poweroff; /* Board is wired for TWL poweroff */ }; -extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); extern int
[PATCH v2 0/5] mfd: twl4030-power: Start DT conversion and updates
Hello, This series enables a partial DT support for twl4030-power. The missing part is the power management scripts, as the required binding should be defined first. It however enables the complete shutdown of the processor at poweroff when booting with DT, dropping the power consumption from around 350 mA on Overo+Tobi to about 40 mA. The poweroff callback was tested with both DT and non-DT boots. The last two patches simplify the error path in the probe function, and fix registers relocking on error. Best regards, Florian Since v1: - use module_platform_driver() - split the refactoring of the probe function into a dedicated patch - new patch to fix registers relocking on error - rebased on mfd-next Florian Vaussard (5): mfd: twl4030-power: Split from twl-core into a dedicated module mfd: twl4030-power: Simplify probing of power scripts and resources mfd: twl4030-power: Start transition to DT mfd: twl4030-power: Simplify error path mfd: twl4030-power: Fix relocking on error .../devicetree/bindings/mfd/twl4030-power.txt | 28 drivers/mfd/twl-core.c | 12 +- drivers/mfd/twl4030-power.c| 149 ++- include/linux/i2c/twl.h|1 - 4 files changed, 146 insertions(+), 44 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 2/5] mfd: twl4030-power: Simplify probing of power scripts and resources
Increase lisibility when probing power scripts and resources by creating dedicated functions. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl4030-power.c | 60 -- 1 files changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 7ade81b..8fa6c7b 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -492,6 +492,39 @@ int twl4030_remove_script(u8 flags) return err; } +int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) +{ + int err; + int i; + u8 address = twl4030_start_script_address; + + for (i = 0; i pdata-num; i++) { + err = load_twl4030_script(pdata-scripts[i], address); + if (err) + return err; + address += pdata-scripts[i]-size; + } + + return 0; +} + +int twl4030_power_configure_resources(struct twl4030_power_data *pdata) +{ + struct twl4030_resconfig *resconfig = pdata-resource_config; + int err; + + if (resconfig) { + while (resconfig-resource) { + err = twl4030_configure_resource(resconfig); + if (err) + return err; + resconfig++; + } + } + + return 0; +} + /* * In master mode, start the power off sequence. * After a successful execution, TWL shuts down the power to the SoC @@ -511,9 +544,7 @@ int twl4030_power_probe(struct platform_device *pdev) { struct twl4030_power_data *pdata = pdev-dev.platform_data; int err = 0; - int i; - struct twl4030_resconfig *resconfig; - u8 val, address = twl4030_start_script_address; + u8 val; err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); @@ -525,23 +556,12 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) goto unlock; - for (i = 0; i pdata-num; i++) { - err = load_twl4030_script(pdata-scripts[i], address); - if (err) - goto load; - address += pdata-scripts[i]-size; - } - - resconfig = pdata-resource_config; - if (resconfig) { - while (resconfig-resource) { - err = twl4030_configure_resource(resconfig); - if (err) - goto resource; - resconfig++; - - } - } + err = twl4030_power_configure_scripts(pdata); + if (err) + goto load; + err = twl4030_power_configure_resources(pdata); + if (err) + goto resource; /* Board has to be wired properly to use this feature */ if (pdata-use_poweroff !pm_power_off) { -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 5/5] mfd: twl4030-power: Fix relocking on error
If an error occurs when loading power scripts or resources, the registers are not correctly relocked. Fix it. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl4030-power.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 1c19d82..a8b33c9 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -558,6 +558,7 @@ int twl4030_power_probe(struct platform_device *pdev) struct twl4030_power_data *pdata = pdev-dev.platform_data; struct device_node *node = pdev-dev.of_node; int err = 0; + int err2 = 0; u8 val; if (!pdata !node) { @@ -581,12 +582,12 @@ int twl4030_power_probe(struct platform_device *pdev) err = twl4030_power_configure_scripts(pdata); if (err) { pr_err(TWL4030 failed to load scripts\n); - return err; + goto relock; } err = twl4030_power_configure_resources(pdata); if (err) { pr_err(TWL4030 failed to configure resource\n); - return err; + goto relock; } } @@ -612,10 +613,13 @@ int twl4030_power_probe(struct platform_device *pdev) } relock: - err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0, + err2 = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0, TWL4030_PM_MASTER_PROTECT_KEY); - if (err) + if (err2) { pr_err(TWL4030 Unable to relock registers\n); + return err2; + } + return err; } -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 3/5] mfd: twl4030-power: Start transition to DT
Support for loading twl4030-power module via devicetree. For now, when booting with a DT, only the poweroff callback feature is supported through the ti,use_poweroff property. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- .../devicetree/bindings/mfd/twl4030-power.txt | 28 drivers/mfd/twl4030-power.c| 45 --- 2 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt new file mode 100644 index 000..8e15ec3 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt @@ -0,0 +1,28 @@ +Texas Instruments TWL family (twl4030) reset and power management module + +The power management module inside the TWL family provides several facilities +to control the power resources, including power scripts. For now, the +binding only supports the complete shutdown of the system after poweroff. + +Required properties: +- compatible : must be ti,twl4030-power + +Optional properties: +- ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or + SLEEP-to-OFF transition when the system poweroffs. + +Example: +i2c1 { + clock-frequency = 260; + + twl: twl@48 { + reg = 0x48; + interrupts = 7; /* SYS_NIRQ cascaded to intc */ + interrupt-parent = intc; + + twl_power: power { + compatible = ti,twl4030-power; + ti,use_poweroff; + }; + }; +}; diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 8fa6c7b..9f59c94 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -28,6 +28,7 @@ #include linux/pm.h #include linux/i2c/twl.h #include linux/platform_device.h +#include linux/of.h #include asm/mach-types.h @@ -540,12 +541,30 @@ void twl4030_power_off(void) pr_err(TWL4030 Unable to power off\n); } +static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata, + struct device_node *node) +{ + if (pdata pdata-use_poweroff) + return true; + + if (of_property_read_bool(node, ti,use_poweroff)) + return true; + + return false; +} + int twl4030_power_probe(struct platform_device *pdev) { struct twl4030_power_data *pdata = pdev-dev.platform_data; + struct device_node *node = pdev-dev.of_node; int err = 0; u8 val; + if (!pdata !node) { + dev_err(pdev-dev, Platform data is missing\n); + return -EINVAL; + } + err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); if (err) @@ -556,15 +575,18 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) goto unlock; - err = twl4030_power_configure_scripts(pdata); - if (err) - goto load; - err = twl4030_power_configure_resources(pdata); - if (err) - goto resource; + if (pdata) { + /* TODO: convert to device tree */ + err = twl4030_power_configure_scripts(pdata); + if (err) + goto load; + err = twl4030_power_configure_resources(pdata); + if (err) + goto resource; + } /* Board has to be wired properly to use this feature */ - if (pdata-use_poweroff !pm_power_off) { + if (twl4030_power_use_poweroff(pdata, node) !pm_power_off) { /* Default for SEQ_OFFSYNC is set, lets ensure this */ err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, val, TWL4030_PM_MASTER_CFG_P123_TRANSITION); @@ -610,10 +632,19 @@ static int twl4030_power_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id twl4030_power_of_match[] = { + {.compatible = ti,twl4030-power, }, + { }, +}; +MODULE_DEVICE_TABLE(of, twl4030_power_of_match); +#endif + static struct platform_driver twl4030_power_driver = { .driver = { .name = twl4030_power, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(twl4030_power_of_match), }, .probe = twl4030_power_probe, .remove = twl4030_power_remove, -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 4/5] mfd: twl4030-power: Simplify error path
Remove unnecessary goto statements, causing duplicated if conditions. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl4030-power.c | 38 +++--- 1 files changed, 15 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 9f59c94..1c19d82 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -567,22 +567,27 @@ int twl4030_power_probe(struct platform_device *pdev) err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); - if (err) - goto unlock; - - err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2, + err |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, + TWL4030_PM_MASTER_KEY_CFG2, TWL4030_PM_MASTER_PROTECT_KEY); - if (err) - goto unlock; + + if (err) { + pr_err(TWL4030 Unable to unlock registers\n); + return err; + } if (pdata) { /* TODO: convert to device tree */ err = twl4030_power_configure_scripts(pdata); - if (err) - goto load; + if (err) { + pr_err(TWL4030 failed to load scripts\n); + return err; + } err = twl4030_power_configure_resources(pdata); - if (err) - goto resource; + if (err) { + pr_err(TWL4030 failed to configure resource\n); + return err; + } } /* Board has to be wired properly to use this feature */ @@ -612,19 +617,6 @@ relock: if (err) pr_err(TWL4030 Unable to relock registers\n); return err; - -unlock: - if (err) - pr_err(TWL4030 Unable to unlock registers\n); - return err; -load: - if (err) - pr_err(TWL4030 failed to load scripts\n); - return err; -resource: - if (err) - pr_err(TWL4030 failed to configure resource\n); - return err; } static int twl4030_power_remove(struct platform_device *pdev) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH] ARM: dts: Protect pinctrl headers against multiple inclusions
Hello Grant, On 06/11/2013 11:57 PM, Grant Likely wrote: On Tue, 11 Jun 2013 16:50:50 +0200, Florian Vaussard florian.vauss...@epfl.ch wrote: Pinctrl headers were not protected with #ifndef. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Obviously this needs to go in via whatever tree added the modified header files. I authored these files, sorry for this stupid omission. Benoit, can you take this patch? Regards, Florian Acked-by: Grant Likely grant.lik...@secretlab.ca --- include/dt-bindings/pinctrl/am33xx.h |5 + include/dt-bindings/pinctrl/omap.h |5 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h index a3fddd4..469e032 100644 --- a/include/dt-bindings/pinctrl/am33xx.h +++ b/include/dt-bindings/pinctrl/am33xx.h @@ -2,6 +2,9 @@ * This header provides constants specific to AM33XX pinctrl bindings. */ +#ifndef _DT_BINDINGS_PINCTRL_AM33XX_H +#define _DT_BINDINGS_PINCTRL_AM33XX_H + #include include/dt-bindings/pinctrl/omap.h /* am33xx specific mux bit defines */ @@ -35,3 +38,5 @@ #undef PIN_OFF_INPUT_PULLDOWN #undef PIN_OFF_WAKEUPENABLE +#endif + diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index 370df3f..edbd250 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -5,6 +5,9 @@ * Copyright (C) 2009-2010 Texas Instruments */ +#ifndef _DT_BINDINGS_PINCTRL_OMAP_H +#define _DT_BINDINGS_PINCTRL_OMAP_H + /* 34xx mux mode options for each pin. See TRM for options */ #define MUX_MODE0 0 #define MUX_MODE1 1 @@ -48,3 +51,5 @@ #define PIN_OFF_INPUT_PULLDOWN(OFF_EN | OFF_PULL_EN) #define PIN_OFF_WAKEUPENABLE WAKEUP_EN +#endif + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss -- Florian Vaussard EPFL - STI - IMT - LSRO1 MEB330 - Station 9 1015 Lausanne / Switzerland tel: +41 21 693 78 39 fax: +41 21 693 78 07 http://lsro.epfl.ch ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 1/3] ARM: dts: Add headers with constants for MTD partitions
These constants can be used to easily declare MTD partitions inside DTS. The constants MTDPART_OFS_* are purposely not included. Indeed, parse_ofpart_partitions() is expecting u64, but a DT cell is u32. Negative constants, as defined by MTDPART_OFS_*, would be wrongly interpreted by parse_ofpart_partitions(). Two cells should be used to correctly encode the negative constants, but this breaks current usage. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/mtd/partitions.h | 12 include/dt-bindings/sizes.h | 52 ++ 2 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/mtd/partitions.h create mode 100644 include/dt-bindings/sizes.h diff --git a/include/dt-bindings/mtd/partitions.h b/include/dt-bindings/mtd/partitions.h new file mode 100644 index 000..7dfa676 --- /dev/null +++ b/include/dt-bindings/mtd/partitions.h @@ -0,0 +1,12 @@ +/* + * This header provides constants used with MTD partitions. + */ + +#ifndef _DT_BINDINGS_MTD_PARTITIONS_H +#define _DT_BINDINGS_MTD_PARTITIONS_H + +/* Partition size */ +#define MTDPART_SIZ_FULL 0 + +#endif + diff --git a/include/dt-bindings/sizes.h b/include/dt-bindings/sizes.h new file mode 100644 index 000..995f2de --- /dev/null +++ b/include/dt-bindings/sizes.h @@ -0,0 +1,52 @@ +/* + * This header provides size constants. + * + * Original version: + * include/linux/sizes.h + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _DT_BINDINGS_SIZES_H +#define _DT_BINDINGS_SIZES_H + +#define SZ_1 0x0001 +#define SZ_2 0x0002 +#define SZ_4 0x0004 +#define SZ_8 0x0008 +#define SZ_16 0x0010 +#define SZ_32 0x0020 +#define SZ_64 0x0040 +#define SZ_128 0x0080 +#define SZ_256 0x0100 +#define SZ_512 0x0200 + +#define SZ_1K 0x0400 +#define SZ_2K 0x0800 +#define SZ_4K 0x1000 +#define SZ_8K 0x2000 +#define SZ_16K 0x4000 +#define SZ_32K 0x8000 +#define SZ_64K 0x0001 +#define SZ_128K0x0002 +#define SZ_256K0x0004 +#define SZ_512K0x0008 + +#define SZ_1M 0x0010 +#define SZ_2M 0x0020 +#define SZ_4M 0x0040 +#define SZ_8M 0x0080 +#define SZ_16M 0x0100 +#define SZ_32M 0x0200 +#define SZ_64M 0x0400 +#define SZ_128M0x0800 +#define SZ_256M0x1000 +#define SZ_512M0x2000 + +#define SZ_1G 0x4000 +#define SZ_2G 0x8000 + +#endif + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/3] ARM: dts: OMAP3: Use constants with MTD devices
Hello, Legacy board files use constants from sizes.h and mtd/partitions.h to declare MTD partitions. This series performs the same with DT. Necessary headers are added (patch 1), a NAND node is added to omap3-overo (patch 2), and remaining DTS are converted (patch 3). Patch 2 was tested on the real hardware. For patch 3, the resulting DTB were diff'ed. The MTDPART_SIZ_FULL constant was used in DTS, when it was the case in legacy board files. The size cell is thus changed inside the binary output, so testing on the hardware is welcome, even if it should work transparently. Note that inside omap3430-sdp.dts (nor@0,0), it appears with this series that partitions 'kernel-nor' and 'filesystem-nor' overlaps by (2*SZ_128K), which is probably not desired. Regards, Florian Florian Vaussard (3): ARM: dts: Add headers with constants for MTD partitions ARM: dts: Add omap3-overo NAND flash memory binding ARM: dts: OMAP3: Use MTD constants for OMAP3 boards arch/arm/boot/dts/omap3-devkit8000.dts | 10 +++--- arch/arm/boot/dts/omap3-igep0020.dts | 10 +++--- arch/arm/boot/dts/omap3-igep0030.dts | 10 +++--- arch/arm/boot/dts/omap3-overo.dtsi | 50 ++ arch/arm/boot/dts/omap3.dtsi |2 + arch/arm/boot/dts/omap3430-sdp.dts | 28 include/dt-bindings/mtd/partitions.h | 12 +++ include/dt-bindings/sizes.h| 52 8 files changed, 145 insertions(+), 29 deletions(-) create mode 100644 include/dt-bindings/mtd/partitions.h create mode 100644 include/dt-bindings/sizes.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 2/3] ARM: dts: Add omap3-overo NAND flash memory binding
Add device-tree node for the on-board NAND memory. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-overo.dtsi | 50 arch/arm/boot/dts/omap3.dtsi |2 + 2 files changed, 52 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index e112a42..811b74c 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -33,6 +33,56 @@ }; }; +gpmc { + ranges = 0 0 0x3000 0x0004; /* CS0: NAND */ + + nand@0,0 { + reg = 0 0 0; /* CS0, offset 0 */ + nand-bus-width = 16; + + ti,nand-ecc-opt = sw; + + gpmc,device-nand; + gpmc,sync-clk-ps = 0; + gpmc,cs-on-ns = 0; + gpmc,cs-rd-off-ns = 36; + gpmc,cs-wr-off-ns = 36; + gpmc,adv-on-ns = 6; + gpmc,adv-rd-off-ns = 24; + gpmc,adv-wr-off-ns = 36; + gpmc,we-off-ns = 30; + gpmc,oe-off-ns = 48; + gpmc,access-ns = 54; + gpmc,rd-cycle-ns = 72; + gpmc,wr-cycle-ns = 72; + gpmc,wr-access-ns = 30; + gpmc,wr-data-mux-bus-ns = 0; + + #address-cells = 1; + #size-cells = 1; + + xloader@0 { + reg = (0 * SZ_128K) (4 * SZ_128K); + }; + + uboot@8 { + reg = (4 * SZ_128K) (14 * SZ_128K); + }; + + ubootenv@24 { + reg = (18 * SZ_128K) (2 * SZ_128K); + }; + + linux@28 { + reg = (20 * SZ_128K) (32 * SZ_128K); + }; + + rootfs@68 { + reg = (52 * SZ_128K) MTDPART_SIZ_FULL; + }; + }; +}; + i2c1 { clock-frequency = 260; diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 6d05ee0..65a9390 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -9,7 +9,9 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/mtd/partitions.h #include dt-bindings/pinctrl/omap.h +#include dt-bindings/sizes.h #include skeleton.dtsi -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 3/3] ARM: dts: OMAP3: Use MTD constants for OMAP3 boards
Use the MTD constants for NAND and OneNAND nodes used in OMAP3 DTS. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-devkit8000.dts | 10 +- arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3430-sdp.dts | 28 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 5be71b1..08699cb 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -143,27 +143,27 @@ x-loader@0 { label = X-Loader; - reg = 0 0x8; + reg = (0 * SZ_128K) (4 * SZ_128K); }; bootloaders@8 { label = U-Boot; - reg = 0x8 0x1e; + reg = (4 * SZ_128K) (15 * SZ_128K); }; bootloaders_env@26 { label = U-Boot Env; - reg = 0x26 0x2; + reg = (19 * SZ_128K) (1 * SZ_128K); }; kernel@28 { label = Kernel; - reg = 0x28 0x40; + reg = (20 * SZ_128K) (32 * SZ_128K); }; filesystem@68 { label = File System; - reg = 0x68 0xf98; + reg = (52 * SZ_128K) MTDPART_SIZ_FULL; }; }; }; diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index e8c4828..3476b3c 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts @@ -97,23 +97,23 @@ partition@0 { label = SPL; - reg = 0 0x10; + reg = (0 * SZ_256K) (4 * SZ_256K); }; partition@0x8 { label = U-Boot; - reg = 0x10 0x18; + reg = (4 * SZ_256K) (6 * SZ_256K); }; partition@0x1c { label = Environment; - reg = 0x28 0x10; + reg = (10 * SZ_256K) (4 * SZ_256K); }; partition@0x28 { label = Kernel; - reg = 0x38 0x30; + reg = (14 * SZ_256K) (12 * SZ_256K); }; partition@0x78 { label = Filesystem; - reg = 0x68 0x1f98; + reg = (26 * SZ_256K) MTDPART_SIZ_FULL; }; }; diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts index 644d053..e4f078c 100644 --- a/arch/arm/boot/dts/omap3-igep0030.dts +++ b/arch/arm/boot/dts/omap3-igep0030.dts @@ -72,23 +72,23 @@ partition@0 { label = SPL; - reg = 0 0x10; + reg = (0 * SZ_256K) (4 * SZ_256K); }; partition@0x8 { label = U-Boot; - reg = 0x10 0x18; + reg = (4 * SZ_256K) (6 * SZ_256K); }; partition@0x1c { label = Environment; - reg = 0x28 0x10; + reg = (10 * SZ_256K) (4 * SZ_256K); }; partition@0x28 { label = Kernel; - reg = 0x38 0x30; + reg = (14 * SZ_256K) (12 * SZ_256K); }; partition@0x78 { label = Filesystem; - reg = 0x68 0x1f98; + reg = (26 * SZ_256K) MTDPART_SIZ_FULL; }; }; }; diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts index 2a725a0..dd69ee0 100644 --- a/arch/arm/boot/dts/omap3430-sdp.dts +++ b/arch/arm/boot/dts/omap3430-sdp.dts @@ -81,19 +81,19 @@ partition@0 { label = bootloader-nor; - reg = 0 0x4; + reg = (0 * SZ_128K) (2 * SZ_128K); }; partition@0x4 { label = params-nor; - reg = 0x4 0x4; + reg = (2 * SZ_128K) (2 * SZ_128K); }; partition@0x8 { label = kernel-nor; - reg = 0x8 0x20
[PATCH 1/4] ARM: dts: OMAP3: Include IRQ header
Some nodes in OMAP3 DTS now use edge or level sensitive interrupts. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3.dtsi |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 6d05ee0..8e1a87f 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -9,6 +9,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/interrupt-controller/irq.h #include dt-bindings/pinctrl/omap.h #include skeleton.dtsi -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 2/4] ARM: dts: omap3-tobi: Add SMSC911X node
The Tobi expansion boards embeds a SMSC LAN8700 PHY. Add the corresponding node into the DT. The regulators are not designed to be turned off. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-tobi.dts | 48 ++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-tobi.dts index c7eebbf..dea726f 100644 --- a/arch/arm/boot/dts/omap3-tobi.dts +++ b/arch/arm/boot/dts/omap3-tobi.dts @@ -24,6 +24,54 @@ linux,default-trigger = heartbeat; }; }; + + vddvario: regulator-vddvario { + compatible = regulator-fixed; + regulator-name = vddvario; + regulator-always-on; + }; + + vdd33a: regulator-vdd33a { + compatible = regulator-fixed; + regulator-name = vdd33a; + regulator-always-on; + }; +}; + +gpmc { + ranges = 5 0 0x2c00 0x100;/* CS5 */ + + ethernet@5,0 { + compatible = smsc,lan9221, smsc,lan9115; + reg = 5 0 0xff; + bank-width = 2; + + gpmc,mux-add-data; + gpmc,cs-on-ns = 0; + gpmc,cs-rd-off-ns = 42; + gpmc,cs-wr-off-ns = 36; + gpmc,adv-on-ns = 6; + gpmc,adv-rd-off-ns = 12; + gpmc,adv-wr-off-ns = 12; + gpmc,oe-on-ns = 0; + gpmc,oe-off-ns = 42; + gpmc,we-on-ns = 0; + gpmc,we-off-ns = 36; + gpmc,rd-cycle-ns = 60; + gpmc,wr-cycle-ns = 54; + gpmc,access-ns = 36; + gpmc,page-burst-access-ns = 0; + gpmc,bus-turnaround-ns = 0; + gpmc,cycle2cycle-delay-ns = 0; + gpmc,wr-data-mux-bus-ns = 18; + gpmc,wr-access-ns = 42; + gpmc,cycle2cycle-samecsen; + gpmc,cycle2cycle-diffcsen; + + interrupt-parent = gpio6; + interrupts = 16 IRQ_TYPE_LEVEL_LOW; /* GPIO 176*/ + reg-io-width = 4; + }; }; i2c3 { -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 3/4] ARM: dts: omap3-tobi: Correct polarity for GPIO LED
The LED is active low, not active high. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-tobi.dts |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-tobi.dts index dea726f..1458591 100644 --- a/arch/arm/boot/dts/omap3-tobi.dts +++ b/arch/arm/boot/dts/omap3-tobi.dts @@ -20,7 +20,7 @@ compatible = gpio-leds; heartbeat { label = overo:red:gpio21; - gpios = gpio1 21 GPIO_ACTIVE_HIGH; + gpios = gpio1 21 GPIO_ACTIVE_LOW; linux,default-trigger = heartbeat; }; }; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/4] ARM: dts: OMAP3: Updates for Overo
Hello, This series performs several updates to omap3-overo and omap3-tobi. Patch 1 is necessary to patch 2 for the IRQ constant. The SMSC911X is largely taken from omap3-igep. Regards, Florian Florian Vaussard (4): ARM: dts: OMAP3: Include IRQ header ARM: dts: omap3-tobi: Add SMSC911X node ARM: dts: omap3-tobi: Correct polarity for GPIO LED ARM: dts: omap3-overo: Add default trigger for TWL4030 LED arch/arm/boot/dts/omap3-overo.dtsi |1 + arch/arm/boot/dts/omap3-tobi.dts | 50 +++- arch/arm/boot/dts/omap3.dtsi |1 + 3 files changed, 51 insertions(+), 1 deletions(-) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 4/4] ARM: dts: omap3-overo: Add default trigger for TWL4030 LED
Commit c971ff1 'leds: leds-pwm: Defer led_pwm_set() if PWM can sleep' fixed a crash when using a trigger with a pwm-led provided by an external chip. Now it is safe to add the default trigger according to board-overo.c. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-overo.dtsi |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index e112a42..0bcc284 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -21,6 +21,7 @@ label = overo:blue:COM; pwms = twl_pwmled 1 7812500; max-brightness = 127; + linux,default-trigger = mmc0; }; }; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH] ARM: dts: omap3-devkit8000: fix NAND memory binding
Hello, On 05/31/2013 03:49 PM, Florian Vaussard wrote: Hello, Gentle ping. Does someone has any comments on this fix? Can someone tests on the real hardware? Nobody has this hardware somewhere in a drawer? :-) Regards, Florian Regards, Florian On 05/23/2013 10:11 AM, Florian Vaussard wrote: Commit d36b4cd 'ARM: OMAP2+: Add additional GPMC timing parameters' updated GPMC binding, but omap3-devkit8000 was not updated accordingly, resulting in a broken configuration. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-devkit8000.dts | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..e5b35f5 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -123,20 +123,21 @@ reg = 0 0 0; /* CS0, offset 0 */ nand-bus-width = 16; -gpmc,sync-clk = 0; -gpmc,cs-on = 0; -gpmc,cs-rd-off = 44; -gpmc,cs-wr-off = 44; -gpmc,adv-on = 6; -gpmc,adv-rd-off = 34; -gpmc,adv-wr-off = 44; -gpmc,we-off = 40; -gpmc,oe-off = 54; -gpmc,access = 64; -gpmc,rd-cycle = 82; -gpmc,wr-cycle = 82; -gpmc,wr-access = 40; -gpmc,wr-data-mux-bus = 0; +gpmc,device-nand; +gpmc,sync-clki-ps = 0; +gpmc,cs-on-ns = 0; +gpmc,cs-rd-off-ns = 44; +gpmc,cs-wr-off-ns = 44; +gpmc,adv-on-ns = 6; +gpmc,adv-rd-off-ns = 34; +gpmc,adv-wr-off-ns = 44; +gpmc,we-off-ns = 40; +gpmc,oe-off-ns = 54; +gpmc,access-ns = 64; +gpmc,rd-cycle-ns = 82; +gpmc,wr-cycle-ns = 82; +gpmc,wr-access-ns = 40; +gpmc,wr-data-mux-bus-ns = 0; #address-cells = 1; #size-cells = 1; -- Florian Vaussard EPFL - STI - IMT - LSRO1 MEB330 - Station 9 1015 Lausanne / Switzerland tel: +41 21 693 78 39 fax: +41 21 693 78 07 http://lsro.epfl.ch ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH] ARM: dts: Protect pinctrl headers against multiple inclusions
Pinctrl headers were not protected with #ifndef. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/pinctrl/am33xx.h |5 + include/dt-bindings/pinctrl/omap.h |5 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h index a3fddd4..469e032 100644 --- a/include/dt-bindings/pinctrl/am33xx.h +++ b/include/dt-bindings/pinctrl/am33xx.h @@ -2,6 +2,9 @@ * This header provides constants specific to AM33XX pinctrl bindings. */ +#ifndef _DT_BINDINGS_PINCTRL_AM33XX_H +#define _DT_BINDINGS_PINCTRL_AM33XX_H + #include include/dt-bindings/pinctrl/omap.h /* am33xx specific mux bit defines */ @@ -35,3 +38,5 @@ #undef PIN_OFF_INPUT_PULLDOWN #undef PIN_OFF_WAKEUPENABLE +#endif + diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index 370df3f..edbd250 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -5,6 +5,9 @@ * Copyright (C) 2009-2010 Texas Instruments */ +#ifndef _DT_BINDINGS_PINCTRL_OMAP_H +#define _DT_BINDINGS_PINCTRL_OMAP_H + /* 34xx mux mode options for each pin. See TRM for options */ #define MUX_MODE0 0 #define MUX_MODE1 1 @@ -48,3 +51,5 @@ #define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) #define PIN_OFF_WAKEUPENABLE WAKEUP_EN +#endif + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/3] ARM: dts: Add headers with constants for MTD partitions
Hello Stephen, On 06/11/2013 06:24 PM, Stephen Warren wrote: On 06/11/2013 08:48 AM, Florian Vaussard wrote: These constants can be used to easily declare MTD partitions inside DTS. The constants MTDPART_OFS_* are purposely not included. Indeed, parse_ofpart_partitions() is expecting u64, but a DT cell is u32. Negative constants, as defined by MTDPART_OFS_*, would be wrongly interpreted by parse_ofpart_partitions(). Two cells should be used to correctly encode the negative constants, but this breaks current usage. I think addition of common headers like this needs an ack from Grant/Rob. I CC'd them here. Indeed. Thank you. diff --git a/include/dt-bindings/mtd/partitions.h b/include/dt-bindings/mtd/partitions.h + * This header provides constants used with MTD partitions. ... +/* Partition size */ +#define MTDPART_SIZ_FULL 0 Which binding document in Documentation/devicetree/bindings is this definition associated with? The comment above should really mention this. Documentation/devicetree/bindings/mtd/partition.txt doesn't seem to mention this value. Mmmh I was not seeing this as a DT binding, strictly speaking. It was already used with legacy board files. Otherwise we should also update the binding for constants related to GPIO, IRQ,... But I agree that a line inside the documentation never killed someone. diff --git a/include/dt-bindings/sizes.h b/include/dt-bindings/sizes.h ... +#define SZ_1G 0x4000 +#define SZ_2G 0x8000 + +#endif For MTD partitions specifically, SZ_4G and onwards would be useful in theory, although that would end up putting two cell values into a single macro. and then the values couldn't be added/or'd together. So, I'm not really sure if we want to add those larger values, but food for thought... It is maybe feasible to define a macro splitting the u64 into two u32 cells? But this can be done afterwards when need arises. Best regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 3/3] ARM: dts: OMAP3: Use MTD constants for OMAP3 boards
Hello Javier, On 06/11/2013 05:29 PM, Javier Martinez Canillas wrote: On 06/11/2013 04:48 PM, Florian Vaussard wrote: Use the MTD constants for NAND and OneNAND nodes used in OMAP3 DTS. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-devkit8000.dts | 10 +- arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3430-sdp.dts | 28 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 5be71b1..08699cb 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -143,27 +143,27 @@ x-loader@0 { label = X-Loader; - reg = 0 0x8; + reg = (0 * SZ_128K) (4 * SZ_128K); }; bootloaders@8 { label = U-Boot; - reg = 0x8 0x1e; + reg = (4 * SZ_128K) (15 * SZ_128K); }; bootloaders_env@26 { label = U-Boot Env; - reg = 0x26 0x2; + reg = (19 * SZ_128K) (1 * SZ_128K); }; kernel@28 { label = Kernel; - reg = 0x28 0x40; + reg = (20 * SZ_128K) (32 * SZ_128K); }; filesystem@68 { label = File System; - reg = 0x68 0xf98; + reg = (52 * SZ_128K) MTDPART_SIZ_FULL; }; }; }; diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index e8c4828..3476b3c 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts @@ -97,23 +97,23 @@ partition@0 { label = SPL; - reg = 0 0x10; + reg = (0 * SZ_256K) (4 * SZ_256K); }; partition@0x8 { label = U-Boot; - reg = 0x10 0x18; + reg = (4 * SZ_256K) (6 * SZ_256K); }; partition@0x1c { label = Environment; - reg = 0x28 0x10; + reg = (10 * SZ_256K) (4 * SZ_256K); }; partition@0x28 { label = Kernel; - reg = 0x38 0x30; + reg = (14 * SZ_256K) (12 * SZ_256K); }; partition@0x78 { label = Filesystem; - reg = 0x68 0x1f98; + reg = (26 * SZ_256K) MTDPART_SIZ_FULL; }; }; diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts index 644d053..e4f078c 100644 --- a/arch/arm/boot/dts/omap3-igep0030.dts +++ b/arch/arm/boot/dts/omap3-igep0030.dts @@ -72,23 +72,23 @@ partition@0 { label = SPL; - reg = 0 0x10; + reg = (0 * SZ_256K) (4 * SZ_256K); }; partition@0x8 { label = U-Boot; - reg = 0x10 0x18; + reg = (4 * SZ_256K) (6 * SZ_256K); }; partition@0x1c { label = Environment; - reg = 0x28 0x10; + reg = (10 * SZ_256K) (4 * SZ_256K); }; partition@0x28 { label = Kernel; - reg = 0x38 0x30; + reg = (14 * SZ_256K) (12 * SZ_256K); }; partition@0x78 { label = Filesystem; - reg = 0x68 0x1f98; + reg = (26 * SZ_256K) MTDPART_SIZ_FULL; }; }; }; Hi Florian, I don't have access to my IGEP board so I can test it right now but the patch looks good to me. In fact I wanted to use MTDPART_SIZ_FULL when added the NAND nodes since not all IGEP boards have 512MB flash but I didn't know that a value of 0 meant that. I had the same problem, and found that 0 was correctly parsed and later expanded to the correct value when probing the NAND. So thanks a lot for doing this! Acked-by: Javier Martinez Canillas javier.marti...@collabora.co.uk Thank you. Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org
Re: [PATCH 3/3] ARM: dts: OMAP3: Use MTD constants for OMAP3 boards
Hello, On 06/11/2013 06:27 PM, Stephen Warren wrote: On 06/11/2013 08:48 AM, Florian Vaussard wrote: Use the MTD constants for NAND and OneNAND nodes used in OMAP3 DTS. I don't quite understand the split between patches 2/3 and 3/3; isn't the edit to omap3-overo.dtsi (part of) a board file, and hence logically part of this patch? I'd be tempted just to squash the two together. But, this is a nit; not a big deal. Patch 2/3 was adding a new node, whereas patch 3/3 was converting existing nodes. But your point is perfectly valid. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [net-next PATCH v4 3/5] ARM: dts: AM33XX: Add pinmux configuration for CPSW to beaglebone
Hello, On 06/05/2013 07:08 PM, Mugunthan V N wrote: Add pinmux configurations for MII based CPSW ethernet to am335x-bone. In this patch, only single named mode/state is added and these pins are configured during pinctrl driver initialization. Default mode is nothing but the values required for the module during active state. With this configurations module is functional as expected. Todo: - if an idle state is available for pins, add support for it. Signed-off-by: Mugunthan V N mugunthan...@ti.com --- arch/arm/boot/dts/am335x-bone.dts | 38 + 1 file changed, 38 insertions(+) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 4b5a8e0..008a13b 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -36,6 +36,33 @@ 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */ ; }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = + /* Slave 1 */ + 0x110 0x20 /* mii1_rxerr.mii1_rxerr, MODE0 | INPUT */ Here I guess that the comment should be INPUT_PULLDOWN, instead of INPUT. + 0x114 0x0 /* mii1_txen.mii1_txen, MODE0 | OUTPUT */ As bit PULLUDENABLE is 0, the pulldown is enabled according to the TRM, right? Is this a desirable behaviour, as it will consume power when outputting a high level? And consequently, the comment should probably be OUTPUT_PULLDOWN, no? + 0x118 0x20 /* mii1_rxdv.mii1_rxdv, MODE0 | INPUT_PULLDOWN */ + 0x11c 0x0 /* mii1_txd3.mii1_txd3, MODE0 | OUTPUT */ + 0x120 0x0 /* mii1_txd2.mii1_txd2, MODE0 | OUTPUT */ + 0x124 0x0 /* mii1_txd1.mii1_txd1, MODE0 | OUTPUT */ + 0x128 0x0 /* mii1_txd0.mii1_txd0, MODE0 | OUTPUT */ Same questions here. + 0x12c 0x20 /* mii1_txclk.mii1_txclk, MODE0 | INPUT_PULLDOWN */ + 0x130 0x20 /* mii1_rxclk.mii1_rxclk, MODE0 | INPUT_PULLDOWN */ + 0x134 0x20 /* mii1_rxd3.mii1_rxd3, MODE0 | INPUT_PULLDOWN */ + 0x138 0x20 /* mii1_rxd2.mii1_rxd2, MODE0 | INPUT_PULLDOWN */ + 0x13c 0x20 /* mii1_rxd1.mii1_rxd1, MODE0 | INPUT_PULLDOWN */ + 0x140 0x20 /* mii1_rxd0.mii1_rxd0, MODE0 | INPUT_PULLDOWN */ + ; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = + /* MDIO */ + 0x148 0x30 /* mdio_data.mdio_data, MODE0 | INPUT_PULLUP */ + 0x14c 0x10 /* mdio_clk.mdio_clk, MODE0 | OUTPUT_PULLUP */ + ; + }; }; ocp { @@ -138,3 +165,14 @@ phy_id = davinci_mdio, 1; phy-mode = mii; }; + +mac { + pinctrl-names = default; + pinctrl-0 = cpsw_default; + +}; + +davinci_mdio { + pinctrl-names = default; + pinctrl-0 = davinci_mdio_default; +}; Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees
Hello, On 06/06/2013 09:22 AM, Benoit Cousson wrote: On 06/06/2013 07:28 AM, Mohammed, Afzal wrote: Hi Benoit, On Wed, Jun 05, 2013 at 18:19:00, Cousson, Benoit wrote: + Afzal, Hi Vaibhav and Afzal, Can someone test this series before I pull it. I still don't have any AM board to do it myself :-( Tested-by: Afzal Mohammed af...@ti.com (am335x evm) Thanks Afzal. Florian, I've just pushed the series including Azal tested-by. I added as well the Makefile change you have done to add missing target with a slight change in the subject: ARM: dts: OMAP4/AM35xx: Add missing dtb in the dtbs target Great, thank you! Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 1/4] ARM: dts: AM3XXX: Use #include for all device trees
Replace /include/ by #include for AM33XX and AM35XX device tree files, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts |2 +- arch/arm/boot/dts/am335x-evm.dts|4 ++-- arch/arm/boot/dts/am335x-evmsk.dts |4 ++-- arch/arm/boot/dts/am33xx.dtsi |2 +- arch/arm/boot/dts/am3517-evm.dts|2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts |2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 74bfcc6..0365e56 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x BeagleBone; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 4dc46fa..9302773 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x EVM; @@ -301,7 +301,7 @@ }; }; -/include/ tps65910.dtsi +#include tps65910.dtsi tps { vcc1-supply = vbat; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 4d81dbc..83ded8e 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -13,7 +13,7 @@ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x EVM-SK; @@ -201,7 +201,7 @@ }; }; -/include/ tps65910.dtsi +#include tps65910.dtsi tps { vcc1-supply = vbat; diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 7818bf4..f6a0117 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,am33xx; diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts index e9b5bda..e99dfaf 100644 --- a/arch/arm/boot/dts/am3517-evm.dts +++ b/arch/arm/boot/dts/am3517-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI AM3517 EVM (AM3517/05); diff --git a/arch/arm/boot/dts/am3517_mt_ventoux.dts b/arch/arm/boot/dts/am3517_mt_ventoux.dts index 5568683..fdf5ce6 100644 --- a/arch/arm/boot/dts/am3517_mt_ventoux.dts +++ b/arch/arm/boot/dts/am3517_mt_ventoux.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TeeJet Mt.Ventoux; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 3/4] ARM: dts: AM33XX: Specific pinctrl header
The pinctrl IP inside the AM33XX family differs slightly from what is found on OMAP2+. Define a specific header to take account of the differences. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/pinctrl/am33xx.h | 37 ++ 1 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/am33xx.h diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h new file mode 100644 index 000..a3fddd4 --- /dev/null +++ b/include/dt-bindings/pinctrl/am33xx.h @@ -0,0 +1,37 @@ +/* + * This header provides constants specific to AM33XX pinctrl bindings. + */ + +#include include/dt-bindings/pinctrl/omap.h + +/* am33xx specific mux bit defines */ +#undef PULL_ENA +#undef INPUT_EN + +#define PULL_DISABLE (1 3) +#define INPUT_EN (1 5) +#define SLEWCTRL_FAST (1 6) + +/* update macro depending on INPUT_EN and PULL_ENA */ +#undef PIN_OUTPUT +#undef PIN_OUTPUT_PULLUP +#undef PIN_OUTPUT_PULLDOWN +#undef PIN_INPUT +#undef PIN_INPUT_PULLUP +#undef PIN_INPUT_PULLDOWN + +#define PIN_OUTPUT (PULL_DISABLE) +#define PIN_OUTPUT_PULLUP (PULL_UP) +#define PIN_OUTPUT_PULLDOWN0 +#define PIN_INPUT (INPUT_EN | PULL_DISABLE) +#define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) +#define PIN_INPUT_PULLDOWN (INPUT_EN) + +/* undef non-existing modes */ +#undef PIN_OFF_NONE +#undef PIN_OFF_OUTPUT_HIGH +#undef PIN_OFF_OUTPUT_LOW +#undef PIN_OFF_INPUT_PULLUP +#undef PIN_OFF_INPUT_PULLDOWN +#undef PIN_OFF_WAKEUPENABLE + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 4/4] ARM: dts: AM33XX: Use pinctrl constants
Using constants for pinctrl allows a better readability, and removes redundancy with comments. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts | 18 +- arch/arm/boot/dts/am335x-evm.dts | 58 ++-- arch/arm/boot/dts/am335x-evmsk.dts | 26 arch/arm/boot/dts/am33xx.dtsi |1 + 4 files changed, 52 insertions(+), 51 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 5bfb7dd..fd48173 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -30,30 +30,30 @@ user_leds_s0: user_leds_s0 { pinctrl-single,pins = - 0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | MODE7 */ - 0x58 0x17 /* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */ - 0x5c 0x7/* gpmc_a7.gpio1_23, OUTPUT | MODE7 */ - 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */ + 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + 0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7)/* gpmc_a6.gpio1_22 */ + 0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */ + 0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7)/* gpmc_a8.gpio1_24 */ ; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = - 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */ - 0x18c 0x30 /* i2c0_scl.i2c0_scl PULLUP | INPUTENABLE | MODE0 */ + 0x188 (PIN_INPUT_PULLUP | MUX_MODE0)/* i2c0_sda.i2c0_sda */ + 0x18c (PIN_INPUT_PULLUP | MUX_MODE0)/* i2c0_scl.i2c0_scl */ ; }; uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = - 0x170 0x30 /* uart0_rxd.uart0_rxd PULLUP | INPUTENABLE | MODE0 */ - 0x174 0x00 /* uart0_txd.uart0_txd PULLDOWN | MODE0 */ + 0x170 (PIN_INPUT_PULLUP | MUX_MODE0)/* uart0_rxd.uart0_rxd */ + 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ ; }; clkout2_pin: pinmux_clkout2_pin { pinctrl-single,pins = - 0x1b4 0x03 /* xdma_event_intr1.clkout2 OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ + 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ ; }; }; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index b74dbdf..2c53247 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -30,65 +30,65 @@ matrix_keypad_s0: matrix_keypad_s0 { pinctrl-single,pins = - 0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | MODE7 */ - 0x58 0x7/* gpmc_a6.gpio1_22, OUTPUT | MODE7 */ - 0x64 0x27 /* gpmc_a9.gpio1_25, INPUT | MODE7 */ - 0x68 0x27 /* gpmc_a10.gpio1_26, INPUT | MODE7 */ - 0x6c 0x27 /* gpmc_a11.gpio1_27, INPUT | MODE7 */ + 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + 0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a6.gpio1_22 */ + 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a9.gpio1_25 */ + 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a10.gpio1_26 */ + 0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.gpio1_27 */ ; }; volume_keys_s0: volume_keys_s0 { pinctrl-single,pins = - 0x150 0x27 /* spi0_sclk.gpio0_2, INPUT | MODE7 */ - 0x154 0x27 /* spi0_d0.gpio0_3, INPUT | MODE7 */ + 0x150 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* spi0_sclk.gpio0_2 */ + 0x154 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* spi0_d0.gpio0_3 */ ; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = - 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0
[PATCH v2 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees
Hello, Following my series for OMAP2+, this series makes use of the C preprocessor when compiling AM3xxx DT files, and accomplishes some improvements to improve overall readability. The .dtb files were diff-tested before and after applying the series to guarantee identity for all targets. To enable pullup/down on the pad, the bit should be cleared on AM33xx, where it should be set on OMAP3. This was wrong in my first version. This series is based on Benoit's 'for_3.11/dts' branch. Regards, Florian From v2: - Rebased on Benoit's 'for_3.11/dts' - Fixed inversed bit to enable pullups ('1' on OMAP, but '0' on AM33xx) Florian Vaussard (4): ARM: dts: AM3XXX: Use #include for all device trees ARM: dts: AM33XX: Use existing constants for GPIOs ARM: dts: AM33XX: Specific pinctrl header ARM: dts: AM33XX: Use pinctrl constants arch/arm/boot/dts/am335x-bone.dts | 28 ++-- arch/arm/boot/dts/am335x-evm.dts| 76 +++--- arch/arm/boot/dts/am335x-evmsk.dts | 46 +- arch/arm/boot/dts/am33xx.dtsi |5 ++- arch/arm/boot/dts/am3517-evm.dts|2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts |2 +- include/dt-bindings/pinctrl/am33xx.h| 37 +++ 7 files changed, 118 insertions(+), 78 deletions(-) create mode 100644 include/dt-bindings/pinctrl/am33xx.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 2/4] ARM: dts: AM33XX: Use existing constants for GPIOs
Use standard GPIO constants to enhance the readability of DT GPIOs. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts |8 arch/arm/boot/dts/am335x-evm.dts | 14 +++--- arch/arm/boot/dts/am335x-evmsk.dts | 16 arch/arm/boot/dts/am33xx.dtsi |2 ++ 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 0365e56..5bfb7dd 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -88,27 +88,27 @@ led@2 { label = beaglebone:green:heartbeat; - gpios = gpio1 21 0; + gpios = gpio1 21 GPIO_ACTIVE_HIGH; linux,default-trigger = heartbeat; default-state = off; }; led@3 { label = beaglebone:green:mmc0; - gpios = gpio1 22 0; + gpios = gpio1 22 GPIO_ACTIVE_HIGH; linux,default-trigger = mmc0; default-state = off; }; led@4 { label = beaglebone:green:usr2; - gpios = gpio1 23 0; + gpios = gpio1 23 GPIO_ACTIVE_HIGH; default-state = off; }; led@5 { label = beaglebone:green:usr3; - gpios = gpio1 24 0; + gpios = gpio1 24 GPIO_ACTIVE_HIGH; default-state = off; }; }; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 9302773..b74dbdf 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -264,12 +264,12 @@ debounce-delay-ms = 5; col-scan-delay-us = 2; - row-gpios = gpio1 25 0/* Bank1, pin25 */ -gpio1 26 0/* Bank1, pin26 */ -gpio1 27 0; /* Bank1, pin27 */ + row-gpios = gpio1 25 GPIO_ACTIVE_HIGH /* Bank1, pin25 */ +gpio1 26 GPIO_ACTIVE_HIGH /* Bank1, pin26 */ +gpio1 27 GPIO_ACTIVE_HIGH; /* Bank1, pin27 */ - col-gpios = gpio1 21 0/* Bank1, pin21 */ -gpio1 22 0; /* Bank1, pin22 */ + col-gpios = gpio1 21 GPIO_ACTIVE_HIGH /* Bank1, pin21 */ +gpio1 22 GPIO_ACTIVE_HIGH; /* Bank1, pin22 */ linux,keymap = 0x008b /* MENU */ 0x019e /* BACK */ @@ -288,14 +288,14 @@ switch@9 { label = volume-up; linux,code = 115; - gpios = gpio0 2 1; + gpios = gpio0 2 GPIO_ACTIVE_LOW; gpio-key,wakeup; }; switch@10 { label = volume-down; linux,code = 114; - gpios = gpio0 3 1; + gpios = gpio0 3 GPIO_ACTIVE_LOW; gpio-key,wakeup; }; }; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 83ded8e..16d17d6 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -144,26 +144,26 @@ led@1 { label = evmsk:green:usr0; - gpios = gpio1 4 0; + gpios = gpio1 4 GPIO_ACTIVE_HIGH; default-state = off; }; led@2 { label = evmsk:green:usr1; - gpios = gpio1 5 0; + gpios = gpio1 5 GPIO_ACTIVE_HIGH; default-state = off; }; led@3 { label = evmsk:green:mmc0; - gpios = gpio1 6 0; + gpios = gpio1 6 GPIO_ACTIVE_HIGH; linux,default-trigger = mmc0; default-state = off; }; led@4 { label = evmsk:green:heartbeat; - gpios = gpio1 7 0; + gpios = gpio1 7 GPIO_ACTIVE_HIGH; linux,default-trigger = heartbeat; default-state = off; }; @@ -177,26 +177,26 @@ switch@1 { label = button0; linux,code = 0x100; - gpios = gpio2 3 0; + gpios = gpio2 3
Re: [PATCH 1/2] gpiolib: add gpio_export_with_name
Hello Linus, On 05/30/2013 11:11 PM, Linus Walleij wrote: On Thu, May 30, 2013 at 10:38 PM, Florian Vaussard florian.vauss...@epfl.ch wrote: Indeed, I work in a robotics lab :-) One of our board (mach-imx/ mx31moboard*.c) controls for example the multiplexing of two cameras sharing the same acquisition bus (I know, a bit hackish). I developed a similar board with an OMAP3. Such control do not fit well in the above-mentioned cases, but we do not need RT processes. It does seem to fit well with V4L and/or the media controller framework though, or is this one of those oh, we don't really like to use V4L so we have this special hack instead things? Sorry, I was not aware of this mux capability inside V4L. Thank you. So we can live without gpio-export for most of our hardware. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v4 4/5] ARM: dts: OMAP2+: Header file for pinctrl constants
Most of the constants are taken from arch/arm/mach-omap2/mux.h. Define some others for the PIN_OUTPUT_* flavours. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Stephen Warren swar...@nvidia.com --- include/dt-bindings/pinctrl/omap.h | 50 1 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h new file mode 100644 index 000..370df3f --- /dev/null +++ b/include/dt-bindings/pinctrl/omap.h @@ -0,0 +1,50 @@ +/* + * This header provides constants for OMAP pinctrl bindings. + * + * Copyright (C) 2009 Nokia + * Copyright (C) 2009-2010 Texas Instruments + */ + +/* 34xx mux mode options for each pin. See TRM for options */ +#define MUX_MODE0 0 +#define MUX_MODE1 1 +#define MUX_MODE2 2 +#define MUX_MODE3 3 +#define MUX_MODE4 4 +#define MUX_MODE5 5 +#define MUX_MODE6 6 +#define MUX_MODE7 7 + +/* 24xx/34xx mux bit defines */ +#define PULL_ENA (1 3) +#define PULL_UP(1 4) +#define ALTELECTRICALSEL (1 5) + +/* 34xx specific mux bit defines */ +#define INPUT_EN (1 8) +#define OFF_EN (1 9) +#define OFFOUT_EN (1 10) +#define OFFOUT_VAL (1 11) +#define OFF_PULL_EN(1 12) +#define OFF_PULL_UP(1 13) +#define WAKEUP_EN (1 14) + +/* 44xx specific mux bit defines */ +#define WAKEUP_EVENT (1 15) + +/* Active pin states */ +#define PIN_OUTPUT 0 +#define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) +#define PIN_OUTPUT_PULLDOWN(PIN_OUTPUT | PULL_ENA) +#define PIN_INPUT INPUT_EN +#define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) +#define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) + +/* Off mode states */ +#define PIN_OFF_NONE 0 +#define PIN_OFF_OUTPUT_HIGH(OFF_EN | OFFOUT_EN | OFFOUT_VAL) +#define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) +#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) +#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) +#define PIN_OFF_WAKEUPENABLE WAKEUP_EN + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v4 2/5] ARM: dts: OMAP2+: Use existing constants for GPIOs
Use standard GPIO constants to enhance the readability of DT GPIOs. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Stephen Warren swar...@nvidia.com --- arch/arm/boot/dts/omap2.dtsi |2 ++ arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|6 +++--- arch/arm/boot/dts/omap3-devkit8000.dts|6 +++--- arch/arm/boot/dts/omap3-evm.dts |2 +- arch/arm/boot/dts/omap3-igep0020.dts |8 arch/arm/boot/dts/omap3-igep0030.dts |8 arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 ++ arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-sdp.dts | 16 arch/arm/boot/dts/omap4.dtsi |2 ++ arch/arm/boot/dts/omap5.dtsi |2 ++ 13 files changed, 36 insertions(+), 28 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index e6e4587..f39b237 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,6 +8,8 @@ * kind, whether express or implied. */ +#include dt-bindings/gpio/gpio.h + #include skeleton.dtsi / { diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index e0ce823..1e580d9 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -29,13 +29,13 @@ heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index fcac96a..434288f 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -28,18 +28,18 @@ compatible = gpio-leds; pmu_stat { label = beagleboard::pmu_stat; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ }; heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8d0f5e4..5be71b1 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -22,21 +22,21 @@ heartbeat { label = devkit8000::led1; - gpios = gpio6 26 0; /* 186 - LED1 */ + gpios = gpio6 26 GPIO_ACTIVE_HIGH; /* 186 - LED1 */ default-state = on; linux,default-trigger = heartbeat; }; mmc { label = devkit8000::led2; - gpios = gpio6 3 0; /* 163 - LED2 */ + gpios = gpio6 3 GPIO_ACTIVE_HIGH;/* 163 - LED2 */ default-state = on; linux,default-trigger = none; }; usr { label = devkit8000::led3; - gpios = gpio6 4 0; /* 164 - LED3 */ + gpios = gpio6 4 GPIO_ACTIVE_HIGH;/* 164 - LED3 */ default-state = on; linux,default-trigger = usr; }; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index d75759b..baa24bb 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -28,7 +28,7 @@ compatible = gpio-leds; ledb { label = omap3evm::ledb; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ linux,default-trigger = default
[PATCH v4 1/5] ARM: dts: OMAP2+: Use #include for all device trees
Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Stephen Warren swar...@nvidia.com --- arch/arm/boot/dts/omap2.dtsi |2 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|4 ++-- arch/arm/boot/dts/omap3-devkit8000.dts|4 ++-- arch/arm/boot/dts/omap3-evm.dts |4 ++-- arch/arm/boot/dts/omap3-igep.dtsi |4 ++-- arch/arm/boot/dts/omap3-igep0020.dts |2 +- arch/arm/boot/dts/omap3-igep0030.dts |2 +- arch/arm/boot/dts/omap3-overo.dtsi|4 ++-- arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 +- arch/arm/boot/dts/omap3430-sdp.dts|4 ++-- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts |4 ++-- arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-panda-es.dts |4 ++-- arch/arm/boot/dts/omap4-panda.dts |4 ++-- arch/arm/boot/dts/omap4-sdp-es23plus.dts |2 +- arch/arm/boot/dts/omap4-sdp.dts |6 +++--- arch/arm/boot/dts/omap4-var-som.dts |4 ++-- arch/arm/boot/dts/omap4.dtsi |2 +- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |2 +- arch/arm/boot/dts/omap5-evm.dts |4 ++-- arch/arm/boot/dts/omap5.dtsi |2 +- 29 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 37aa748..e6e4587 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,omap2430, ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts index 68282ee..224c08f 100644 --- a/arch/arm/boot/dts/omap2420-h4.dts +++ b/arch/arm/boot/dts/omap2420-h4.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap2420.dtsi +#include omap2420.dtsi / { model = TI OMAP2420 H4 board; diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index da5b285..c8f9c55 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index 054bc44..c535a5a 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2430, ti,omap2; diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 3046d1f..e0ce823 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap36xx.dtsi +#include omap36xx.dtsi / { model = TI OMAP3 BeagleBoard xM; @@ -75,7 +75,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi i2c2 { clock-frequency = 40; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 6eec699..fcac96a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 BeagleBoard; @@ -107,7 +107,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..8d0f5e4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TimLL OMAP3 Devkit8000; compatible = timll,omap3-devkit8000, ti,omap3; @@ -80,7 +80,7 @@ status = disabled; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index 96d1c20..d75759b 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI
[PATCH v4 0/5] ARM: dts: OMAP2+: Use preprocessor for device trees
Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 1 is a preparation for the rest of the series. Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT. As for previous versions, the .dtb files were diff-tested before and after applying the series to guarantee identity for all targets. The same series for AM3XXX will follow shortly. Best regards, Florian From v3: - Rebased on Benoit's for_3.11/dts branch From v2: - Address Tony's comments (standardize comments, remove OMAP_ prefix) From v1: - Remove duplicated fix - Remove OMAP_GPIO macro - Add pinctrl constants Florian Vaussard (5): ARM: dts: OMAP2+: Use #include for all device trees ARM: dts: OMAP2+: Use existing constants for GPIOs ARM: dts: OMAP4/5: Use existing constants for IRQs ARM: dts: OMAP2+: Header file for pinctrl constants ARM: dts: OMAP2+: Use pinctrl constants arch/arm/boot/dts/omap2.dtsi |5 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |8 +- arch/arm/boot/dts/omap3-beagle.dts| 34 arch/arm/boot/dts/omap3-devkit8000.dts| 10 +- arch/arm/boot/dts/omap3-evm.dts |6 +- arch/arm/boot/dts/omap3-igep.dtsi | 38 arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3-overo.dtsi|4 +- arch/arm/boot/dts/omap3-tobi.dts |4 +- arch/arm/boot/dts/omap3.dtsi |5 +- arch/arm/boot/dts/omap3430-sdp.dts|4 +- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts | 10 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 70 arch/arm/boot/dts/omap4-panda-es.dts | 10 +- arch/arm/boot/dts/omap4-panda.dts |4 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |8 +- arch/arm/boot/dts/omap4-sdp.dts | 126 ++-- arch/arm/boot/dts/omap4-var-som.dts |8 +- arch/arm/boot/dts/omap4.dtsi | 118 ++- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |6 +- arch/arm/boot/dts/omap5-evm.dts | 92 ++-- arch/arm/boot/dts/omap5.dtsi | 128 +++-- include/dt-bindings/pinctrl/omap.h| 50 +++ 30 files changed, 422 insertions(+), 358 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v4 3/5] ARM: dts: OMAP4/5: Use existing constants for IRQs
Use the constants defined in include/dt-bindings/interrupt-controller/ to enhance readability. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Stephen Warren swar...@nvidia.com --- arch/arm/boot/dts/omap4-panda-common.dtsi |8 +- arch/arm/boot/dts/omap4-sdp.dts |6 +- arch/arm/boot/dts/omap4-var-som.dts |4 +- arch/arm/boot/dts/omap4.dtsi | 113 +- arch/arm/boot/dts/omap4460.dtsi |4 +- arch/arm/boot/dts/omap5.dtsi | 123 +++-- 6 files changed, 130 insertions(+), 128 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index f5bec4d..8d09cf5 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -165,16 +165,16 @@ twl: twl@48 { reg = 0x48; - /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + /* IRQ# = 7 */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; twl6040: twl@4b { compatible = ti,twl6040; reg = 0x4b; - /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + /* IRQ# = 119 */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts index 7a26194..e9df3ea 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts @@ -306,7 +306,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; @@ -314,7 +314,7 @@ compatible = ti,twl6040; reg = 0x4b; /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ @@ -395,7 +395,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio2; - interrupts = 2 8; /* gpio line 34, low triggered */ + interrupts = 2 IRQ_TYPE_LEVEL_LOW; /* gpio line 34 */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4-var-som.dts b/arch/arm/boot/dts/omap4-var-som.dts index 6593607..b41269e 100644 --- a/arch/arm/boot/dts/omap4-var-som.dts +++ b/arch/arm/boot/dts/omap4-var-som.dts @@ -34,7 +34,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; }; @@ -68,7 +68,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio6; - interrupts = 11 8; /* gpio line 171, low triggered */ + interrupts = 11 IRQ_TYPE_LEVEL_LOW; /* gpio line 171 */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 4160d7d..6137aff 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -7,6 +7,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h #include skeleton.dtsi @@ -50,7 +51,7 @@ local-timer@0x48240600 { compatible = arm,cortex-a9-twd-timer; reg = 0x48240600 0x20; - interrupts = 1 13 0x304; + interrupts = GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH); }; /* @@ -91,8 +92,8 @@ reg = 0x4400 0x1000, 0x4480 0x2000, 0x4500 0x1000; - interrupts = 0 9 0x4, -0 10 0x4; + interrupts = GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH; counter32k: counter@4a304000
[PATCH v4 5/5] ARM: dts: OMAP2+: Use pinctrl constants
Using constants for pinctrl allows a better readability, and removes redundancy with comments. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Stephen Warren swar...@nvidia.com --- arch/arm/boot/dts/omap2.dtsi |1 + arch/arm/boot/dts/omap3-beagle.dts| 24 arch/arm/boot/dts/omap3-igep.dtsi | 34 +- arch/arm/boot/dts/omap3.dtsi |1 + arch/arm/boot/dts/omap4-panda-a4.dts |6 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 54 arch/arm/boot/dts/omap4-panda-es.dts |6 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |6 +- arch/arm/boot/dts/omap4-sdp.dts | 98 ++-- arch/arm/boot/dts/omap4.dtsi |1 + arch/arm/boot/dts/omap5-evm.dts | 88 +- arch/arm/boot/dts/omap5.dtsi |1 + 12 files changed, 162 insertions(+), 158 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index f39b237..b3cc896 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -9,6 +9,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/pinctrl/omap.h #include skeleton.dtsi diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 434288f..6d47c4b 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (PIN_OUTPUT | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_clk */ + 0x5c2 (PIN_OUTPUT | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_stp */ + 0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dir */ + 0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_nxt */ + 0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat0 */ + 0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat1 */ + 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat2 */ + 0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat3 */ + 0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat4 */ + 0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat5 */ + 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat6 */ + 0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat7 */ ; }; }; diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index d1d2ba7..5224c29 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi @@ -29,43 +29,43 @@ omap3_pmx_core { uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = - 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */ - 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */ + 0x152 (PIN_INPUT | MUX_MODE0) /* uart1_rx.uart1_rx */ + 0x14c (PIN_OUTPUT |MUX_MODE0) /* uart1_tx.uart1_tx */ ; }; uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = - 0x14a 0x100
[PATCH 1/4] ARM: dts: AM3XXX: Use #include for all device trees
Replace /include/ by #include for AM33XX and AM35XX device tree files, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts |2 +- arch/arm/boot/dts/am335x-evm.dts|2 +- arch/arm/boot/dts/am335x-evmsk.dts |2 +- arch/arm/boot/dts/am33xx.dtsi |2 +- arch/arm/boot/dts/am3517-evm.dts|2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts |2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 74bfcc6..0365e56 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x BeagleBone; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 896d392..629476e 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x EVM; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 4d81dbc..a339a76 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -13,7 +13,7 @@ /dts-v1/; -/include/ am33xx.dtsi +#include am33xx.dtsi / { model = TI AM335x EVM-SK; diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index a3daebb..016c460 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,am33xx; diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts index e9b5bda..e99dfaf 100644 --- a/arch/arm/boot/dts/am3517-evm.dts +++ b/arch/arm/boot/dts/am3517-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI AM3517 EVM (AM3517/05); diff --git a/arch/arm/boot/dts/am3517_mt_ventoux.dts b/arch/arm/boot/dts/am3517_mt_ventoux.dts index 5568683..fdf5ce6 100644 --- a/arch/arm/boot/dts/am3517_mt_ventoux.dts +++ b/arch/arm/boot/dts/am3517_mt_ventoux.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TeeJet Mt.Ventoux; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees
Hello, Following my series for OMAP2+, this series makes use of the C preprocessor when compiling AM3XXX DT files, and accomplishes some improvements to improve overall readability. The .dtb files were diff-tested before and after applying the series to guarantee identity for all targets. For the am335x boards, I spotted a few output pins with pullup selected, but not enabled. Although it seems a bit strange to me, I left the state untouched. Has someone a rational for this? Is the pullup later activated? Or is it unintentional? This series depends on my previous series ARM: dts: OMAP2+: Use preprocessor for device trees, itself based on Benoit's for_3.11/dts branch. Regards, Florian Florian Vaussard (4): ARM: dts: AM3XXX: Use #include for all device trees ARM: dts: AM33XX: Use existing constants for GPIOs ARM: dts: AM33XX: Specific pinctrl header ARM: dts: AM33XX: Use pinctrl constants arch/arm/boot/dts/am335x-bone.dts | 28 ++-- arch/arm/boot/dts/am335x-evm.dts| 44 +++--- arch/arm/boot/dts/am335x-evmsk.dts | 44 +++--- arch/arm/boot/dts/am33xx.dtsi |5 +++- arch/arm/boot/dts/am3517-evm.dts|2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts |2 +- include/dt-bindings/pinctrl/am33xx.h| 19 + 7 files changed, 83 insertions(+), 61 deletions(-) create mode 100644 include/dt-bindings/pinctrl/am33xx.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 3/4] ARM: dts: AM33XX: Specific pinctrl header
The pinctrl IP inside the AM33XX family differs slightly from what is found on OMAP2+. Define a specific header to take account of the differences. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/pinctrl/am33xx.h | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/am33xx.h diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h new file mode 100644 index 000..9ffb6c2 --- /dev/null +++ b/include/dt-bindings/pinctrl/am33xx.h @@ -0,0 +1,19 @@ +/* + * This header provides constants specific to AM33XX pinctrl bindings. + */ + +#include include/dt-bindings/pinctrl/omap.h + +/* am33xx specific mux bit defines */ +#undef INPUT_EN +#define INPUT_EN (1 5) +#define SLEWCTRL_FAST (1 6) + +/* update macro depending on INPUT_EN */ +#undef PIN_INPUT +#undef PIN_INPUT_PULLUP +#undef PIN_INPUT_PULLDOWN +#define PIN_INPUT INPUT_EN +#define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) +#define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants
Using constants for pinctrl allows a better readability, and removes redundancy with comments. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts | 18 +- arch/arm/boot/dts/am335x-evm.dts | 28 ++-- arch/arm/boot/dts/am335x-evmsk.dts | 26 +- arch/arm/boot/dts/am33xx.dtsi |1 + 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 5bfb7dd..61d0793 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -30,30 +30,30 @@ user_leds_s0: user_leds_s0 { pinctrl-single,pins = - 0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | MODE7 */ - 0x58 0x17 /* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */ - 0x5c 0x7/* gpmc_a7.gpio1_23, OUTPUT | MODE7 */ - 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */ + 0x54 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + 0x58 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /* gpmc_a6.gpio1_22 */ + 0x5c (PIN_OUTPUT | MUX_MODE7) /* gpmc_a7.gpio1_23 */ + 0x60 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /* gpmc_a8.gpio1_24 */ ; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = - 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */ - 0x18c 0x30 /* i2c0_scl.i2c0_scl PULLUP | INPUTENABLE | MODE0 */ + 0x188 (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + 0x18c (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ ; }; uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = - 0x170 0x30 /* uart0_rxd.uart0_rxd PULLUP | INPUTENABLE | MODE0 */ - 0x174 0x00 /* uart0_txd.uart0_txd PULLDOWN | MODE0 */ + 0x170 (PIN_INPUT | PULL_UP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + 0x174 (PIN_OUTPUT | MUX_MODE0) /* uart0_txd.uart0_txd */ ; }; clkout2_pin: pinmux_clkout2_pin { pinctrl-single,pins = - 0x1b4 0x03 /* xdma_event_intr1.clkout2 OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ + 0x1b4 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr1.clkout2 */ ; }; }; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 0fbecfd..0ee69ec 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -30,45 +30,45 @@ matrix_keypad_s0: matrix_keypad_s0 { pinctrl-single,pins = - 0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | MODE7 */ - 0x58 0x7/* gpmc_a6.gpio1_22, OUTPUT | MODE7 */ - 0x64 0x27 /* gpmc_a9.gpio1_25, INPUT | MODE7 */ - 0x68 0x27 /* gpmc_a10.gpio1_26, INPUT | MODE7 */ - 0x6c 0x27 /* gpmc_a11.gpio1_27, INPUT | MODE7 */ + 0x54 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a5.gpio1_21 */ + 0x58 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a6.gpio1_22 */ + 0x64 (PIN_INPUT | MUX_MODE7)/* gpmc_a9.gpio1_25 */ + 0x68 (PIN_INPUT | MUX_MODE7)/* gpmc_a10.gpio1_26 */ + 0x6c (PIN_INPUT | MUX_MODE7)/* gpmc_a11.gpio1_27 */ ; }; volume_keys_s0: volume_keys_s0 { pinctrl-single,pins = - 0x150 0x27 /* spi0_sclk.gpio0_2, INPUT | MODE7 */ - 0x154 0x27 /* spi0_d0.gpio0_3, INPUT | MODE7 */ + 0x150 (PIN_INPUT | MUX_MODE7) /* spi0_sclk.gpio0_2 */ + 0x154 (PIN_INPUT | MUX_MODE7) /* spi0_d0.gpio0_3 */ ; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = - 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */ - 0x18c 0x30
[PATCH 2/4] ARM: dts: AM33XX: Use existing constants for GPIOs
Use standard GPIO constants to enhance the readability of DT GPIOs. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/am335x-bone.dts |8 arch/arm/boot/dts/am335x-evm.dts | 14 +++--- arch/arm/boot/dts/am335x-evmsk.dts | 16 arch/arm/boot/dts/am33xx.dtsi |2 ++ 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 0365e56..5bfb7dd 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -88,27 +88,27 @@ led@2 { label = beaglebone:green:heartbeat; - gpios = gpio1 21 0; + gpios = gpio1 21 GPIO_ACTIVE_HIGH; linux,default-trigger = heartbeat; default-state = off; }; led@3 { label = beaglebone:green:mmc0; - gpios = gpio1 22 0; + gpios = gpio1 22 GPIO_ACTIVE_HIGH; linux,default-trigger = mmc0; default-state = off; }; led@4 { label = beaglebone:green:usr2; - gpios = gpio1 23 0; + gpios = gpio1 23 GPIO_ACTIVE_HIGH; default-state = off; }; led@5 { label = beaglebone:green:usr3; - gpios = gpio1 24 0; + gpios = gpio1 24 GPIO_ACTIVE_HIGH; default-state = off; }; }; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 629476e..0fbecfd 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -159,12 +159,12 @@ debounce-delay-ms = 5; col-scan-delay-us = 2; - row-gpios = gpio1 25 0/* Bank1, pin25 */ -gpio1 26 0/* Bank1, pin26 */ -gpio1 27 0; /* Bank1, pin27 */ + row-gpios = gpio1 25 GPIO_ACTIVE_HIGH /* Bank1, pin25 */ +gpio1 26 GPIO_ACTIVE_HIGH /* Bank1, pin26 */ +gpio1 27 GPIO_ACTIVE_HIGH; /* Bank1, pin27 */ - col-gpios = gpio1 21 0/* Bank1, pin21 */ -gpio1 22 0; /* Bank1, pin22 */ + col-gpios = gpio1 21 GPIO_ACTIVE_HIGH /* Bank1, pin21 */ +gpio1 22 GPIO_ACTIVE_HIGH; /* Bank1, pin22 */ linux,keymap = 0x008b /* MENU */ 0x019e /* BACK */ @@ -183,14 +183,14 @@ switch@9 { label = volume-up; linux,code = 115; - gpios = gpio0 2 1; + gpios = gpio0 2 GPIO_ACTIVE_LOW; gpio-key,wakeup; }; switch@10 { label = volume-down; linux,code = 114; - gpios = gpio0 3 1; + gpios = gpio0 3 GPIO_ACTIVE_LOW; gpio-key,wakeup; }; }; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index a339a76..289ba2c 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -144,26 +144,26 @@ led@1 { label = evmsk:green:usr0; - gpios = gpio1 4 0; + gpios = gpio1 4 GPIO_ACTIVE_HIGH; default-state = off; }; led@2 { label = evmsk:green:usr1; - gpios = gpio1 5 0; + gpios = gpio1 5 GPIO_ACTIVE_HIGH; default-state = off; }; led@3 { label = evmsk:green:mmc0; - gpios = gpio1 6 0; + gpios = gpio1 6 GPIO_ACTIVE_HIGH; linux,default-trigger = mmc0; default-state = off; }; led@4 { label = evmsk:green:heartbeat; - gpios = gpio1 7 0; + gpios = gpio1 7 GPIO_ACTIVE_HIGH; linux,default-trigger = heartbeat; default-state = off; }; @@ -177,26 +177,26 @@ switch@1 { label = button0; linux,code = 0x100; - gpios = gpio2 3 0; + gpios = gpio2 3
Re: [PATCH] ARM: dts: omap3-devkit8000: fix NAND memory binding
Hello, Gentle ping. Does someone has any comments on this fix? Can someone tests on the real hardware? Regards, Florian On 05/23/2013 10:11 AM, Florian Vaussard wrote: Commit d36b4cd 'ARM: OMAP2+: Add additional GPMC timing parameters' updated GPMC binding, but omap3-devkit8000 was not updated accordingly, resulting in a broken configuration. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-devkit8000.dts | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..e5b35f5 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -123,20 +123,21 @@ reg = 0 0 0; /* CS0, offset 0 */ nand-bus-width = 16; - gpmc,sync-clk = 0; - gpmc,cs-on = 0; - gpmc,cs-rd-off = 44; - gpmc,cs-wr-off = 44; - gpmc,adv-on = 6; - gpmc,adv-rd-off = 34; - gpmc,adv-wr-off = 44; - gpmc,we-off = 40; - gpmc,oe-off = 54; - gpmc,access = 64; - gpmc,rd-cycle = 82; - gpmc,wr-cycle = 82; - gpmc,wr-access = 40; - gpmc,wr-data-mux-bus = 0; + gpmc,device-nand; + gpmc,sync-clki-ps = 0; + gpmc,cs-on-ns = 0; + gpmc,cs-rd-off-ns = 44; + gpmc,cs-wr-off-ns = 44; + gpmc,adv-on-ns = 6; + gpmc,adv-rd-off-ns = 34; + gpmc,adv-wr-off-ns = 44; + gpmc,we-off-ns = 40; + gpmc,oe-off-ns = 54; + gpmc,access-ns = 64; + gpmc,rd-cycle-ns = 82; + gpmc,wr-cycle-ns = 82; + gpmc,wr-access-ns = 40; + gpmc,wr-data-mux-bus-ns = 0; #address-cells = 1; #size-cells = 1; -- Florian Vaussard EPFL - STI - IMT - LSRO1 MEB330 - Station 9 1015 Lausanne / Switzerland tel: +41 21 693 78 39 fax: +41 21 693 78 07 http://lsro.epfl.ch ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 1/1] ARM: dts: OMAP4/AM35xx: Fix missing dtb in the dtbs target
When making the dtbs target on OMAP/AM35xx, some trees are not built. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/Makefile |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b9f7121..8eadd4e 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -149,10 +149,13 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ omap4-panda-es.dtb \ omap4-var-som.dtb \ omap4-sdp.dtb \ + omap4-sdp-es23plus.dtb \ omap5-evm.dtb \ am335x-evm.dtb \ am335x-evmsk.dtb \ - am335x-bone.dtb + am335x-bone.dtb \ + am3517-evm.dtb \ + am3517_mt_ventoux.dtb dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \ -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 0/1] ARM: dts: OMAP4/AM35xx: Fix missing dtb in the dtbs target
Hello, When testing the OMAP/AM35xx DTS, I noticed that some platforms were missing from the dtbs target, forcing the user to build them manually. This patch corrects this. Regards, Florian Since v1: - Added AM35xx missing platforms Florian Vaussard (1): ARM: dts: OMAP4/AM35xx: Fix missing dtb in the dtbs target arch/arm/boot/dts/Makefile |5 - 1 files changed, 4 insertions(+), 1 deletions(-) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v9] ARM: dts: omap4-panda: Update the LED support for the panda DTS
Hello Dan, On 05/31/2013 05:19 PM, Dan Murphy wrote: The GPIO for LED D1 on the omap4-panda a1-a3 rev and the omap4-panda-es are different. A1-A3 = gpio_wk7 ES = gpio_110 There is no change to LED D2 Abstract away the pinmux and the LED definitions for the two boards into the respective DTS files. Signed-off-by: Dan Murphy dmur...@ti.com --- v9 - Removed comments for mux config - https://patchwork.kernel.org/patch/2644391/ v8 - Rebase to latest and use pinctrl macros - https://patchwork.kernel.org/patch/2629351/ v7 - Update headline to add spaces - https://patchwork.kernel.org/patch/2583661/ v6 - Review comments updated - https://patchwork.kernel.org/patch/2582771/ v5 - Provide pincrtl phandle to the gpio-led driver - https://patchwork.kernel.org/patch/2573981/ arch/arm/boot/dts/omap4-panda-common.dtsi | 16 +++- arch/arm/boot/dts/omap4-panda-es.dts | 28 2 files changed, 43 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index d5d144a..800fa4e 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -16,8 +16,13 @@ reg = 0x8000 0x4000; /* 1 GB */ }; - leds { + leds: leds { compatible = gpio-leds; + pinctrl-names = default; + pinctrl-0 = + led_wkgpio_pins + ; + heartbeat { label = pandaboard::status1; gpios = gpio1 7 GPIO_ACTIVE_HIGH; @@ -157,6 +162,15 @@ }; }; +omap4_pmx_wkup { + led_wkgpio_pins: pinmux_leds_wkpins { + pinctrl-single,pins = + 0x1a (PIN_OUTPUT | MUX_MODE3) /* gpio_wk7 */ + 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */ + ; + }; +}; + i2c1 { pinctrl-names = default; pinctrl-0 = i2c1_pins; diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts index 5cfdf19..0a7812f 100644 --- a/arch/arm/boot/dts/omap4-panda-es.dts +++ b/arch/arm/boot/dts/omap4-panda-es.dts @@ -34,3 +34,31 @@ 0x5e (PIN_INPUT | MUX_MODE0)/* hdmi_sda.hdmi_sda */ ; }; + +omap4_pmx_core { + led_gpio_pins: gpio_led_pmx { + pinctrl-single,pins = + 0xb6 (PIN_OUTPUT | MUX_MODE3) /* gpio_110 */ + ; + }; +}; + +led_wkgpio_pins { + pinctrl-single,pins = + 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */ + ; +}; + +leds { + pinctrl-0 = + led_gpio_pins + led_wkgpio_pins + ; + + heartbeat { + gpios = gpio4 14 0; And here you could use the GPIO defines: gpios = gpio4 14 GPIO_ACTIVE_HIGH; + }; + mmc { + gpios = gpio1 8 0; Same here. + }; +}; Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 1/1] ARM: dts: OMAP4/AM35xx: Fix missing dtb in the dtbs target
Hello Benoit, On 05/31/2013 04:45 PM, Benoit Cousson wrote: On 05/31/2013 04:05 PM, Florian Vaussard wrote: When making the dtbs target on OMAP/AM35xx, some trees are not built. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Thanks for the fix Florian. I need to applied your AM series first to take that one otherwise the am3517-evm will fail since it depends on omap3.dtsi. Right. It was a bad idea to split in two series, sorry. BTW, I applied some more AM patches in my branch, and I cannot apply ARM: dts: AM33XX: Use pinctrl constants anymore. Just wait for some review from AM folks before updating the whole series. Ok, I will rebase on your branch in the coming days. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v1] ARM: dts: omap4-panda: Update the twl6040 gpio to macro definition
Hello Dan, On 05/31/2013 05:45 PM, Dan Murphy wrote: Update the dt property ti,audpwron-gpio to use the gpio macro definition for GPIO_ACTIVE_HIGH. Signed-off-by: Dan Murphy dmur...@ti.com --- arch/arm/boot/dts/omap4-panda-common.dtsi |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index 800fa4e..00cbaa5 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -190,7 +190,7 @@ /* IRQ# = 119 */ interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; - ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ + ti,audpwron-gpio = gpio4 31 GPIO_ACTIVE_HIGH; /* gpio line 127 */ vio-supply = v1v8; v2v1-supply = v2v1; I missed it during the conversion, thank you. Reviewed-by: Florian Vaussard florian.vauss...@epfl.ch ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] gpiolib: add gpio_export_with_name
Hello Grant, On 11/26/2012 02:59 PM, Grant Likely wrote: On Wed, 21 Nov 2012 11:14:08 +0100, Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com wrote: allow to specify a name to an exported gpio Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com The gpio sysfs ABI is already horrible, racy, and unsafe. Really, we need a proper chrdev interface for controlling gpios. Sysfs is fine for poking around and experimenting, but we cannot provide any fine grained access control, locking or faster IO with the one-file-per-gpio sysfs model. So, no, I don't think this is a good idea to extend gpiolib in this way. Would it make sense to provide only the DT binding to export a GPIO, without changing the sysfs ABI? Even if work is progressing towards having gpio-controlled reset pins [1], some boards still need GPIOs to be exported to userspace for other functionalities. Regards, Florian [1] http://article.gmane.org/gmane.linux.power-management.general/31364 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/3] mfd: twl4030-power: Start DT conversion
Hello, This series enables a partial DT support for twl4030-power. The missing part is the power management scripts, as the required binding should be defined first. It however enables the complete shutdown of the processor at poweroff when booting with DT, dropping the power consumption from around 350 mA on Overo+Tobi to about 40 mA. The poweroff callback was tested with both DT and non-DT boots. Best regards, Florian Florian Vaussard (3): mfd: twl4030-power: Split from twl-core into a dedicated module mfd: twl4030-power: Start transition to DT mfd: twl4030-power: Simplify error path .../devicetree/bindings/mfd/twl4030-power.txt | 28 drivers/mfd/twl-core.c | 12 +- drivers/mfd/twl4030-power.c| 149 +++- include/linux/i2c/twl.h|1 - 4 files changed, 148 insertions(+), 42 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 1/3] mfd: twl4030-power: Split from twl-core into a dedicated module
For now, the call to twl4030-power is hard-wired inside twl-core. To ease the future transition to DT, make twl4030-power as a separate module, like what is already done for twl4030-audio and others. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl-core.c | 12 ++--- drivers/mfd/twl4030-power.c | 54 +++ include/linux/i2c/twl.h |1 - 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 89ab4d9..d1b9d14 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -1023,6 +1023,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, return PTR_ERR(child); } + if (IS_ENABLED(CONFIG_TWL4030_POWER) pdata-power) { + child = add_child(TWL_MODULE_PM_MASTER, twl4030_power, + pdata-power, sizeof(*pdata-power), false, + 0, 0); + if (IS_ERR(child)) + return PTR_ERR(child); + } + return 0; } @@ -1234,10 +1242,6 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) WARN(status 0, Error: reading twl_idcode register value\n); } - /* load power event scripts */ - if (IS_ENABLED(CONFIG_TWL4030_POWER) pdata pdata-power) - twl4030_power_init(pdata-power); - /* Maybe init the T2 Interrupt subsystem */ if (client-irq) { if (twl_class_is_4030()) { diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index dd362c1..c9a2a5c 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -507,8 +507,9 @@ void twl4030_power_off(void) pr_err(TWL4030 Unable to power off\n); } -void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) +int twl4030_power_probe(struct platform_device *pdev) { + struct twl4030_power_data *pdata = pdev-dev.platform_data; int err = 0; int i; struct twl4030_resconfig *resconfig; @@ -524,14 +525,14 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) if (err) goto unlock; - for (i = 0; i twl4030_scripts-num; i++) { - err = load_twl4030_script(twl4030_scripts-scripts[i], address); + for (i = 0; i pdata-num; i++) { + err = load_twl4030_script(pdata-scripts[i], address); if (err) goto load; - address += twl4030_scripts-scripts[i]-size; + address += pdata-scripts[i]-size; } - resconfig = twl4030_scripts-resource_config; + resconfig = pdata-resource_config; if (resconfig) { while (resconfig-resource) { err = twl4030_configure_resource(resconfig); @@ -543,7 +544,7 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts) } /* Board has to be wired properly to use this feature */ - if (twl4030_scripts-use_poweroff !pm_power_off) { + if (pdata-use_poweroff !pm_power_off) { /* Default for SEQ_OFFSYNC is set, lets ensure this */ err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, val, TWL4030_PM_MASTER_CFG_P123_TRANSITION); @@ -568,18 +569,51 @@ relock: TWL4030_PM_MASTER_PROTECT_KEY); if (err) pr_err(TWL4030 Unable to relock registers\n); - return; + return err; unlock: if (err) pr_err(TWL4030 Unable to unlock registers\n); - return; + return err; load: if (err) pr_err(TWL4030 failed to load scripts\n); - return; + return err; resource: if (err) pr_err(TWL4030 failed to configure resource\n); - return; + return err; +} + +static int twl4030_power_remove(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver twl4030_power_driver = { + .driver = { + .name = twl4030_power, + .owner = THIS_MODULE, + }, + .probe = twl4030_power_probe, + .remove = twl4030_power_remove, +}; + +static int __init twl4030_power_init(void) +{ + return platform_driver_register(twl4030_power_driver); } +subsys_initcall(twl4030_power_init); + +static void __exit twl4030_power_exit(void) +{ + platform_driver_unregister(twl4030_power_driver); +} +module_exit(twl4030_power_exit); + +MODULE_AUTHOR(Nokia Corporation); +MODULE_AUTHOR(Texas Instruments, Inc.); +MODULE_DESCRIPTION(Power management for TWL4030); +MODULE_LICENSE(GPL); +MODULE_ALIAS(platform:twl4030_power); + diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 488debb..2167c0d0 100644 --- a/include/linux/i2c/twl.h
[PATCH 2/3] mfd: twl4030-power: Start transition to DT
Support for loading twl4030-power module via devicetree. For now, when booting with a DT, only the poweroff callback feature is supported through the ti,use_poweroff property. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- .../devicetree/bindings/mfd/twl4030-power.txt | 28 +++ drivers/mfd/twl4030-power.c| 86 +++ 2 files changed, 96 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt new file mode 100644 index 000..8e15ec3 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt @@ -0,0 +1,28 @@ +Texas Instruments TWL family (twl4030) reset and power management module + +The power management module inside the TWL family provides several facilities +to control the power resources, including power scripts. For now, the +binding only supports the complete shutdown of the system after poweroff. + +Required properties: +- compatible : must be ti,twl4030-power + +Optional properties: +- ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or + SLEEP-to-OFF transition when the system poweroffs. + +Example: +i2c1 { + clock-frequency = 260; + + twl: twl@48 { + reg = 0x48; + interrupts = 7; /* SYS_NIRQ cascaded to intc */ + interrupt-parent = intc; + + twl_power: power { + compatible = ti,twl4030-power; + ti,use_poweroff; + }; + }; +}; diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index c9a2a5c..d12d748 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -28,6 +28,7 @@ #include linux/pm.h #include linux/i2c/twl.h #include linux/platform_device.h +#include linux/of.h #include asm/mach-types.h @@ -492,6 +493,39 @@ int twl4030_remove_script(u8 flags) return err; } +int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) +{ + int err; + int i; + u8 address = twl4030_start_script_address; + + for (i = 0; i pdata-num; i++) { + err = load_twl4030_script(pdata-scripts[i], address); + if (err) + return err; + address += pdata-scripts[i]-size; + } + + return 0; +} + +int twl4030_power_configure_resources(struct twl4030_power_data *pdata) +{ + struct twl4030_resconfig *resconfig = pdata-resource_config; + int err; + + if (resconfig) { + while (resconfig-resource) { + err = twl4030_configure_resource(resconfig); + if (err) + return err; + resconfig++; + } + } + + return 0; +} + /* * In master mode, start the power off sequence. * After a successful execution, TWL shuts down the power to the SoC @@ -507,13 +541,29 @@ void twl4030_power_off(void) pr_err(TWL4030 Unable to power off\n); } +static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata, + struct device_node *node) +{ + if (pdata pdata-use_poweroff) + return true; + + if (of_property_read_bool(node, ti,use_poweroff)) + return true; + + return false; +} + int twl4030_power_probe(struct platform_device *pdev) { struct twl4030_power_data *pdata = pdev-dev.platform_data; + struct device_node *node = pdev-dev.of_node; int err = 0; - int i; - struct twl4030_resconfig *resconfig; - u8 val, address = twl4030_start_script_address; + u8 val; + + if (!pdata !node) { + dev_err(pdev-dev, Platform data is missing\n); + return -EINVAL; + } err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); @@ -525,26 +575,17 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) goto unlock; - for (i = 0; i pdata-num; i++) { - err = load_twl4030_script(pdata-scripts[i], address); + if (pdata) { + err = twl4030_power_configure_scripts(pdata); if (err) goto load; - address += pdata-scripts[i]-size; - } - - resconfig = pdata-resource_config; - if (resconfig) { - while (resconfig-resource) { - err = twl4030_configure_resource(resconfig); - if (err) - goto resource; - resconfig++; - - } + err = twl4030_power_configure_resources(pdata
[PATCH 3/3] mfd: twl4030-power: Simplify error path
Remove unnecessary goto statements, causing duplicated if conditions. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- drivers/mfd/twl4030-power.c | 37 ++--- 1 files changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index d12d748..7eed526 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -567,21 +567,25 @@ int twl4030_power_probe(struct platform_device *pdev) err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); - if (err) - goto unlock; - - err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2, + err |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2, TWL4030_PM_MASTER_PROTECT_KEY); - if (err) - goto unlock; + + if (err) { + pr_err(TWL4030 Unable to unlock registers\n); + return err; + } if (pdata) { err = twl4030_power_configure_scripts(pdata); - if (err) - goto load; + if (err) { + pr_err(TWL4030 failed to load scripts\n); + return err; + } err = twl4030_power_configure_resources(pdata); - if (err) - goto resource; + if (err) { + pr_err(TWL4030 failed to configure resource\n); + return err; + } } /* Board has to be wired properly to use this feature */ @@ -611,19 +615,6 @@ relock: if (err) pr_err(TWL4030 Unable to relock registers\n); return err; - -unlock: - if (err) - pr_err(TWL4030 Unable to unlock registers\n); - return err; -load: - if (err) - pr_err(TWL4030 failed to load scripts\n); - return err; -resource: - if (err) - pr_err(TWL4030 failed to configure resource\n); - return err; } static int twl4030_power_remove(struct platform_device *pdev) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] gpiolib: add gpio_export_with_name
Hello Linus, On 05/30/2013 10:03 PM, Linus Walleij wrote: On Thu, May 30, 2013 at 11:19 AM, Florian Vaussard florian.vauss...@epfl.ch wrote: Even if work is progressing towards having gpio-controlled reset pins [1], some boards still need GPIOs to be exported to userspace for other functionalities. Which are these? Sorry, I should have been more precise. When I have inquired I have heard all kind of horrible things: - Userspace replicating drivers/leds/leds-gpio.c to turn on/off and even PWM (!) LEDs from userspace, when we have a standard sysfs interface for LEDs. - Userspace replicating drivers/input/keyboard/gpio_keys[_polled].c to just read this one button instead of going through the Linux input subsystem like everyone else. - Userspace replicating drivers/regulator/gpio-regulator.c to turn on just this one voltage source. All invalid reasons for using the sysfs ABI and trying to do the kernels work. All creating horrs for users and developers who now have to stash everything were trying to stach into the device tree (the above is all perfectly expressed with DT nodes) into their userspace app and then requiring their users to match a certain app to a certain board. 100% agree with you. The only examples I've really come to accept considers using things like relays and switches on factory lines where the meaning (semantics) of the GPIOs can only be properly understood from the GUI in the userspace APP running that factory line. Or robotics. In both cases presumably RT processes. Indeed, I work in a robotics lab :-) One of our board (mach-imx/ mx31moboard*.c) controls for example the multiplexing of two cameras sharing the same acquisition bus (I know, a bit hackish). I developed a similar board with an OMAP3. Such control do not fit well in the above-mentioned cases, but we do not need RT processes. Best regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 14/14] ARM: dts: AM43x: initial support
Hello, On 05/29/2013 10:53 AM, Benoit Cousson wrote: + Florian Hi Afzal, On 05/27/2013 04:37 PM, Afzal Mohammed wrote: DT source (minimal) for AM4372 SoC to represent AM43x SoC's. Those represented here are the minimal DT nodes necessary to get kernel booting. In DT nodes, ti,hwmod property has not been added, this would be added along with PRCM support for AM43x. Signed-off-by: Ankur Kishore a-kish...@ti.com Signed-off-by: Afzal Mohammed af...@ti.com --- v2: Add gptimer 1ms, timer2, synctimer and remove twd local timer arch/arm/boot/dts/am4372.dtsi | 66 +++ 1 file changed, 66 insertions(+) create mode 100644 arch/arm/boot/dts/am4372.dtsi diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi new file mode 100644 index 000..1d58298 --- /dev/null +++ b/arch/arm/boot/dts/am4372.dtsi @@ -0,0 +1,66 @@ +/* + * Device Tree Source for AM4372 SoC + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * + * 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/ skeleton.dtsi You can now use the C preprocessor statement instead of this one. Florian already started doing the change [1]. Beside that detail, that patch looks good to me. I'll pull it separately of the series. If you pull the patch in your branch, I can take care of the changes when I rebase my series. This will allow me to clean the 'interrupts' statements below as well. Regards, Florian Regards, Benoit [1] http://thread.gmane.org/gmane.linux.ports.arm.omap/98320 + +/ { + compatible = ti,am4372, ti,am43; + interrupt-parent = gic; + + + aliases { + serial0 = uart1; + }; + + cpus { + cpu@0 { + compatible = arm,cortex-a9; + }; + }; + + gic: interrupt-controller@48241000 { + compatible = arm,cortex-a9-gic; + interrupt-controller; + #interrupt-cells = 3; + reg = 0x48241000 0x1000, + 0x48240100 0x0100; + }; + + ocp { + compatible = simple-bus; + #address-cells = 1; + #size-cells = 1; + ranges; + + uart1: serial@44e09000 { + compatible = ti,am4372-uart,ti,omap2-uart; + reg = 0x44e09000 0x2000; + interrupts = 0 72 0x4; + }; + + timer1: timer@44e31000 { + compatible = ti,am4372-timer-1ms,ti,am335x-timer-1ms; + reg = 0x44e31000 0x400; + interrupts = 0 67 0x4; + ti,timer-alwon; + }; + + timer2: timer@4804 { + compatible = ti,am4372-timer,ti,am335x-timer; + reg = 0x4804 0x400; + interrupts = 0 68 0x4; + }; + + counter32k: counter@44e86000 { + compatible = ti,am4372-counter32k,ti,omap-counter32k; + reg = 0x44e86000 0x40; + }; + }; +}; ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v3 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
On 05/27/2013 04:52 PM, Florian Vaussard wrote: Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. I realized that I should also address am* devices. I will wait for comments on this version, then post a v4. Sorry for the noise. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
On 05/28/2013 05:07 PM, Stephen Warren wrote: On 05/23/2013 09:36 AM, Florian Vaussard wrote: Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 1 is a preparation for the rest of the series. Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT. For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity. The series briefly, Reviewed-by: Stephen Warren swar...@nvidia.com Thank you. FYI, I posted a v3 addressing Tony's comments [1]. Regards, Florian [1] http://thread.gmane.org/gmane.linux.ports.arm.omap/98320 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 5/5] ARM: dts: OMAP2+: use pinctrl constants
Hello Tony, Thanks for your review. On 05/23/2013 08:46 PM, Tony Lindgren wrote: * Florian Vaussard florian.vauss...@epfl.ch [130523 08:42]: index f39b237..b3cc896 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -9,6 +9,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/pinctrl/omap.h #include skeleton.dtsi diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 434288f..2518e6a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk */ + 0x5c2 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp */ + 0x5c4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir */ + 0x5c6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt */ + 0x5c8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 */ + 0x5cA (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 */ + 0x1a4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 */ + 0x1a6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 */ + 0x1a8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 */ + 0x1aa (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 */ + 0x1ac (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 */ + 0x1ae (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 */ ; }; }; Nice! While at it, can you lowercase the USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk naming to usbb2_ulpittl_clk.usbb1_ulpiphy_clk? You can also leave out _MUXMODE from these for consistency. Sure. I will send out a v3 ASAP. I wonder if we can leave out the OMAP_ prefix from the mux mode defines here and just assume PIN_OUTPUT etc would not conflict with other SoC's naming? We can avoid conflicts as long as we do not include two headers from two different arch, which should not happen if designed with care. I will do the change. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH v2 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
Hello Santosh, Thank you for your review. On 05/23/2013 06:00 PM, Santosh Shilimkar wrote: On Thursday 23 May 2013 11:36 AM, Florian Vaussard wrote: Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 1 is a preparation for the rest of the series. Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT. For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity. Florian Vaussard (5): ARM: dts: OMAP2+: use #include for all device trees ARM: dts: OMAP2+: use existing constants for GPIOs ARM: dts: OMAP4/5: use existing constants for IRQs ARM: dts: OMAP2+: header file for pinctrl constants ARM: dts: OMAP2+: use pinctrl constants I just quickly scanned the series and patches looks good to my eyes. Its a nice clean-up to align OMAP dts files with others. FWIW, Acked-by: Santosh Shilimkar santosh.shilim...@ti.com I will send a v3 with minor changes to address Tony's comments, with your Ack if ok for you. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v3 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 1 is a preparation for the rest of the series. Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT. As for v2, the .dtb files were diff-tested before and after applying the series to guarantee identity for all targets. Best regards, Florian From v2: - Address Tony's comments (standardize comments, remove OMAP_ prefix) From v1: - Remove duplicated fix - Remove OMAP_GPIO macro - Add pinctrl constants Florian Vaussard (5): ARM: dts: OMAP2+: use #include for all device trees ARM: dts: OMAP2+: use existing constants for GPIOs ARM: dts: OMAP4/5: use existing constants for IRQs ARM: dts: OMAP2+: header file for pinctrl constants ARM: dts: OMAP2+: use pinctrl constants arch/arm/boot/dts/omap2.dtsi |5 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |8 +- arch/arm/boot/dts/omap3-beagle.dts| 34 arch/arm/boot/dts/omap3-devkit8000.dts| 10 +- arch/arm/boot/dts/omap3-evm.dts |6 +- arch/arm/boot/dts/omap3-igep.dtsi | 36 arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3-overo.dtsi|4 +- arch/arm/boot/dts/omap3-tobi.dts |4 +- arch/arm/boot/dts/omap3.dtsi |5 +- arch/arm/boot/dts/omap3430-sdp.dts|4 +- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts | 10 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 66 arch/arm/boot/dts/omap4-panda-es.dts | 10 +- arch/arm/boot/dts/omap4-panda.dts |4 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |8 +- arch/arm/boot/dts/omap4-sdp.dts | 122 ++-- arch/arm/boot/dts/omap4-var-som.dts |8 +- arch/arm/boot/dts/omap4.dtsi | 118 ++- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |6 +- arch/arm/boot/dts/omap5-evm.dts | 92 +++--- arch/arm/boot/dts/omap5.dtsi | 126 +++-- include/dt-bindings/pinctrl/omap.h| 50 +++ 30 files changed, 416 insertions(+), 352 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v3 1/5] ARM: dts: OMAP2+: use #include for all device trees
Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- arch/arm/boot/dts/omap2.dtsi |2 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|4 ++-- arch/arm/boot/dts/omap3-devkit8000.dts|4 ++-- arch/arm/boot/dts/omap3-evm.dts |4 ++-- arch/arm/boot/dts/omap3-igep.dtsi |4 ++-- arch/arm/boot/dts/omap3-igep0020.dts |2 +- arch/arm/boot/dts/omap3-igep0030.dts |2 +- arch/arm/boot/dts/omap3-overo.dtsi|4 ++-- arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 +- arch/arm/boot/dts/omap3430-sdp.dts|4 ++-- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts |4 ++-- arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-panda-es.dts |4 ++-- arch/arm/boot/dts/omap4-panda.dts |4 ++-- arch/arm/boot/dts/omap4-sdp-es23plus.dts |2 +- arch/arm/boot/dts/omap4-sdp.dts |6 +++--- arch/arm/boot/dts/omap4-var-som.dts |4 ++-- arch/arm/boot/dts/omap4.dtsi |2 +- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |2 +- arch/arm/boot/dts/omap5-evm.dts |4 ++-- arch/arm/boot/dts/omap5.dtsi |2 +- 29 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 37aa748..e6e4587 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,omap2430, ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts index 68282ee..224c08f 100644 --- a/arch/arm/boot/dts/omap2420-h4.dts +++ b/arch/arm/boot/dts/omap2420-h4.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap2420.dtsi +#include omap2420.dtsi / { model = TI OMAP2420 H4 board; diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index da5b285..c8f9c55 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index 054bc44..c535a5a 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2430, ti,omap2; diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 3046d1f..e0ce823 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap36xx.dtsi +#include omap36xx.dtsi / { model = TI OMAP3 BeagleBoard xM; @@ -75,7 +75,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi i2c2 { clock-frequency = 40; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 6eec699..fcac96a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 BeagleBoard; @@ -107,7 +107,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..8d0f5e4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TimLL OMAP3 Devkit8000; compatible = timll,omap3-devkit8000, ti,omap3; @@ -80,7 +80,7 @@ status = disabled; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index 96d1c20..d75759b 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 EVM (OMAP3530, AM/DM37x); @@ -44,7 +44,7
[PATCH v3 2/5] ARM: dts: OMAP2+: use existing constants for GPIOs
Use standard GPIO constants to enhance the readability of DT GPIOs. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- arch/arm/boot/dts/omap2.dtsi |2 ++ arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|6 +++--- arch/arm/boot/dts/omap3-devkit8000.dts|6 +++--- arch/arm/boot/dts/omap3-evm.dts |2 +- arch/arm/boot/dts/omap3-igep0020.dts |8 arch/arm/boot/dts/omap3-igep0030.dts |8 arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 ++ arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-sdp.dts | 16 arch/arm/boot/dts/omap4.dtsi |2 ++ arch/arm/boot/dts/omap5.dtsi |2 ++ 13 files changed, 36 insertions(+), 28 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index e6e4587..f39b237 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,6 +8,8 @@ * kind, whether express or implied. */ +#include dt-bindings/gpio/gpio.h + #include skeleton.dtsi / { diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index e0ce823..1e580d9 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -29,13 +29,13 @@ heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index fcac96a..434288f 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -28,18 +28,18 @@ compatible = gpio-leds; pmu_stat { label = beagleboard::pmu_stat; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ }; heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8d0f5e4..5be71b1 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -22,21 +22,21 @@ heartbeat { label = devkit8000::led1; - gpios = gpio6 26 0; /* 186 - LED1 */ + gpios = gpio6 26 GPIO_ACTIVE_HIGH; /* 186 - LED1 */ default-state = on; linux,default-trigger = heartbeat; }; mmc { label = devkit8000::led2; - gpios = gpio6 3 0; /* 163 - LED2 */ + gpios = gpio6 3 GPIO_ACTIVE_HIGH;/* 163 - LED2 */ default-state = on; linux,default-trigger = none; }; usr { label = devkit8000::led3; - gpios = gpio6 4 0; /* 164 - LED3 */ + gpios = gpio6 4 GPIO_ACTIVE_HIGH;/* 164 - LED3 */ default-state = on; linux,default-trigger = usr; }; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index d75759b..baa24bb 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -28,7 +28,7 @@ compatible = gpio-leds; ledb { label = omap3evm::ledb; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ linux,default-trigger = default-on; }; }; diff --git a/arch/arm/boot/dts
[PATCH v3 3/5] ARM: dts: OMAP4/5: use existing constants for IRQs
Use the constants defined in include/dt-bindings/interrupt-controller/ to enhance readability. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- arch/arm/boot/dts/omap4-panda-common.dtsi |8 +- arch/arm/boot/dts/omap4-sdp.dts |6 +- arch/arm/boot/dts/omap4-var-som.dts |4 +- arch/arm/boot/dts/omap4.dtsi | 113 ++- arch/arm/boot/dts/omap4460.dtsi |4 +- arch/arm/boot/dts/omap5.dtsi | 121 +++-- 6 files changed, 129 insertions(+), 127 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index a3ef2bd..16b03fd 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -145,16 +145,16 @@ twl: twl@48 { reg = 0x48; - /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + /* IRQ# = 7 */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; twl6040: twl@4b { compatible = ti,twl6040; reg = 0x4b; - /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + /* IRQ# = 119 */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts index 564d19b..509e27c 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts @@ -286,7 +286,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; @@ -294,7 +294,7 @@ compatible = ti,twl6040; reg = 0x4b; /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ @@ -375,7 +375,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio2; - interrupts = 2 8; /* gpio line 34, low triggered */ + interrupts = 2 IRQ_TYPE_LEVEL_LOW; /* gpio line 34, low triggered */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4-var-som.dts b/arch/arm/boot/dts/omap4-var-som.dts index 6593607..135ba45 100644 --- a/arch/arm/boot/dts/omap4-var-som.dts +++ b/arch/arm/boot/dts/omap4-var-som.dts @@ -34,7 +34,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; }; @@ -68,7 +68,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio6; - interrupts = 11 8; /* gpio line 171, low triggered */ + interrupts = 11 IRQ_TYPE_LEVEL_LOW; /* gpio line 171, low triggered */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 00f6ab9..d4304a2 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -15,6 +15,7 @@ /memreserve/ 0x9d00 0x0300; #include dt-bindings/gpio/gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h #include skeleton.dtsi @@ -58,7 +59,7 @@ local-timer@0x48240600 { compatible = arm,cortex-a9-twd-timer; reg = 0x48240600 0x20; - interrupts = 1 13 0x304; + interrupts = GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH); }; /* @@ -99,8 +100,8 @@ reg = 0x4400 0x1000, 0x4480 0x2000, 0x4500 0x1000; - interrupts = 0 9 0x4, -0 10 0x4; + interrupts = GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH; counter32k: counter@4a304000
[PATCH v3 4/5] ARM: dts: OMAP2+: header file for pinctrl constants
Most of the constants are taken from arch/arm/mach-omap2/mux.h. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- include/dt-bindings/pinctrl/omap.h | 50 1 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h new file mode 100644 index 000..370df3f --- /dev/null +++ b/include/dt-bindings/pinctrl/omap.h @@ -0,0 +1,50 @@ +/* + * This header provides constants for OMAP pinctrl bindings. + * + * Copyright (C) 2009 Nokia + * Copyright (C) 2009-2010 Texas Instruments + */ + +/* 34xx mux mode options for each pin. See TRM for options */ +#define MUX_MODE0 0 +#define MUX_MODE1 1 +#define MUX_MODE2 2 +#define MUX_MODE3 3 +#define MUX_MODE4 4 +#define MUX_MODE5 5 +#define MUX_MODE6 6 +#define MUX_MODE7 7 + +/* 24xx/34xx mux bit defines */ +#define PULL_ENA (1 3) +#define PULL_UP(1 4) +#define ALTELECTRICALSEL (1 5) + +/* 34xx specific mux bit defines */ +#define INPUT_EN (1 8) +#define OFF_EN (1 9) +#define OFFOUT_EN (1 10) +#define OFFOUT_VAL (1 11) +#define OFF_PULL_EN(1 12) +#define OFF_PULL_UP(1 13) +#define WAKEUP_EN (1 14) + +/* 44xx specific mux bit defines */ +#define WAKEUP_EVENT (1 15) + +/* Active pin states */ +#define PIN_OUTPUT 0 +#define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) +#define PIN_OUTPUT_PULLDOWN(PIN_OUTPUT | PULL_ENA) +#define PIN_INPUT INPUT_EN +#define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) +#define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) + +/* Off mode states */ +#define PIN_OFF_NONE 0 +#define PIN_OFF_OUTPUT_HIGH(OFF_EN | OFFOUT_EN | OFFOUT_VAL) +#define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) +#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) +#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) +#define PIN_OFF_WAKEUPENABLE WAKEUP_EN + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v3 5/5] ARM: dts: OMAP2+: use pinctrl constants
Using constants for pinctrl allows a better readability, and remove redundancy with comments. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- arch/arm/boot/dts/omap2.dtsi |1 + arch/arm/boot/dts/omap3-beagle.dts| 24 arch/arm/boot/dts/omap3-igep.dtsi | 32 +- arch/arm/boot/dts/omap3.dtsi |1 + arch/arm/boot/dts/omap4-panda-a4.dts |6 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 50 arch/arm/boot/dts/omap4-panda-es.dts |6 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |6 +- arch/arm/boot/dts/omap4-sdp.dts | 94 ++-- arch/arm/boot/dts/omap4.dtsi |1 + arch/arm/boot/dts/omap5-evm.dts | 88 +- arch/arm/boot/dts/omap5.dtsi |1 + 12 files changed, 157 insertions(+), 153 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index f39b237..b3cc896 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -9,6 +9,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/pinctrl/omap.h #include skeleton.dtsi diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 434288f..6d47c4b 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (PIN_OUTPUT | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_clk */ + 0x5c2 (PIN_OUTPUT | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_stp */ + 0x5c4 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dir */ + 0x5c6 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_nxt */ + 0x5c8 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat0 */ + 0x5cA (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat1 */ + 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat2 */ + 0x1a6 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat3 */ + 0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat4 */ + 0x1aa (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat5 */ + 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat6 */ + 0x1ae (PIN_INPUT_PULLDOWN | MUX_MODE3) /* usbb2_ulpitll_clk.usbb1_ulpiphy_dat7 */ ; }; }; diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index 54588b0..7b62b80 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi @@ -29,37 +29,37 @@ omap3_pmx_core { uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = - 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */ - 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */ + 0x152 (PIN_INPUT | MUX_MODE0) /* uart1_rx.uart1_rx */ + 0x14c (PIN_OUTPUT |MUX_MODE0) /* uart1_tx.uart1_tx */ ; }; uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = - 0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0
[PATCH 1/2] ARM: dts: Add omap3-overo NAND flash memory binding
Add device-tree node for the on-board NAND memory. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-overo.dtsi | 50 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index a626c50..be81303 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -33,6 +33,56 @@ }; }; +gpmc { + ranges = 0 0 0x3000 0x0004; /* CS0: NAND */ + + nand@0,0 { + reg = 0 0 0; /* CS0, offset 0 */ + nand-bus-width = 16; + + ti,nand-ecc-opt = sw; + + gpmc,device-nand; + gpmc,sync-clk-ps = 0; + gpmc,cs-on-ns = 0; + gpmc,cs-rd-off-ns = 36; + gpmc,cs-wr-off-ns = 36; + gpmc,adv-on-ns = 6; + gpmc,adv-rd-off-ns = 24; + gpmc,adv-wr-off-ns = 36; + gpmc,we-off-ns = 30; + gpmc,oe-off-ns = 48; + gpmc,access-ns = 54; + gpmc,rd-cycle-ns = 72; + gpmc,wr-cycle-ns = 72; + gpmc,wr-access-ns = 30; + gpmc,wr-data-mux-bus-ns = 0; + + #address-cells = 1; + #size-cells = 1; + + xloader@0 { + reg = 0x 0x0008; /* 4 * SZ_128K */ + }; + + uboot@8 { + reg = 0x0008 0x001c; /* 14 * SZ_128K */ + }; + + ubootenv@24 { + reg = 0x0024 0x0004; /* 2 * SZ_128K */ + }; + + linux@28 { + reg = 0x0028 0x0040; /* 32 * SZ_128K */ + }; + + rootfs@68 { + reg = 0x0068 0x; /* MTDPART_SIZ_FULL */ + }; + }; +}; + i2c1 { clock-frequency = 260; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 2/2] ARM: dts: omap3-overo: add default trigger for TWL4030 LED
Commit c971ff1 'leds: leds-pwm: Defer led_pwm_set() if PWM can sleep' fixed a crash when using a trigger with a pwm-led provided by an external chip. Now it is safe to add the default trigger according to board-overo.c. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-overo.dtsi |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index be81303..8624fb8 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -21,6 +21,7 @@ label = overo:blue:COM; pwms = twl_pwmled 1 7812500; max-brightness = 127; + linux,default-trigger = mmc0; }; }; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/2] ARM: dts: updates for omap3-overo
Hello, This series adds support to omap3-overo for the onboard NAND memory, and restore the default trigger for the pwm-led provided by TWL4030. Best regards, Florian Florian Vaussard (2): ARM: dts: Add omap3-overo NAND flash memory binding ARM: dts: omap3-overo: add default trigger for TWL4030 LED arch/arm/boot/dts/omap3-overo.dtsi | 51 1 files changed, 51 insertions(+), 0 deletions(-) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH] ARM: dts: omap3-devkit8000: fix NAND memory binding
Commit d36b4cd 'ARM: OMAP2+: Add additional GPMC timing parameters' updated GPMC binding, but omap3-devkit8000 was not updated accordingly, resulting in a broken configuration. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-devkit8000.dts | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..e5b35f5 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -123,20 +123,21 @@ reg = 0 0 0; /* CS0, offset 0 */ nand-bus-width = 16; - gpmc,sync-clk = 0; - gpmc,cs-on = 0; - gpmc,cs-rd-off = 44; - gpmc,cs-wr-off = 44; - gpmc,adv-on = 6; - gpmc,adv-rd-off = 34; - gpmc,adv-wr-off = 44; - gpmc,we-off = 40; - gpmc,oe-off = 54; - gpmc,access = 64; - gpmc,rd-cycle = 82; - gpmc,wr-cycle = 82; - gpmc,wr-access = 40; - gpmc,wr-data-mux-bus = 0; + gpmc,device-nand; + gpmc,sync-clki-ps = 0; + gpmc,cs-on-ns = 0; + gpmc,cs-rd-off-ns = 44; + gpmc,cs-wr-off-ns = 44; + gpmc,adv-on-ns = 6; + gpmc,adv-rd-off-ns = 34; + gpmc,adv-wr-off-ns = 44; + gpmc,we-off-ns = 40; + gpmc,oe-off-ns = 54; + gpmc,access-ns = 64; + gpmc,rd-cycle-ns = 82; + gpmc,wr-cycle-ns = 82; + gpmc,wr-access-ns = 40; + gpmc,wr-data-mux-bus-ns = 0; #address-cells = 1; #size-cells = 1; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 1 is a preparation for the rest of the series. Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT. For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity. Best regards, Florian From v1: - Remove duplicated fix - Remove OMAP_GPIO macro - Add pinctrl constants Florian Vaussard (5): ARM: dts: OMAP2+: use #include for all device trees ARM: dts: OMAP2+: use existing constants for GPIOs ARM: dts: OMAP4/5: use existing constants for IRQs ARM: dts: OMAP2+: header file for pinctrl constants ARM: dts: OMAP2+: use pinctrl constants arch/arm/boot/dts/omap2.dtsi |5 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |8 +- arch/arm/boot/dts/omap3-beagle.dts| 34 arch/arm/boot/dts/omap3-devkit8000.dts| 10 +- arch/arm/boot/dts/omap3-evm.dts |6 +- arch/arm/boot/dts/omap3-igep.dtsi | 36 arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3-overo.dtsi|4 +- arch/arm/boot/dts/omap3-tobi.dts |4 +- arch/arm/boot/dts/omap3.dtsi |5 +- arch/arm/boot/dts/omap3430-sdp.dts|4 +- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts | 10 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 66 arch/arm/boot/dts/omap4-panda-es.dts | 10 +- arch/arm/boot/dts/omap4-panda.dts |4 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |8 +- arch/arm/boot/dts/omap4-sdp.dts | 122 ++-- arch/arm/boot/dts/omap4-var-som.dts |8 +- arch/arm/boot/dts/omap4.dtsi | 118 ++- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |6 +- arch/arm/boot/dts/omap5-evm.dts | 92 +++--- arch/arm/boot/dts/omap5.dtsi | 126 +++-- include/dt-bindings/pinctrl/omap.h| 54 30 files changed, 420 insertions(+), 352 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 1/5] ARM: dts: OMAP2+: use #include for all device trees
Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap2.dtsi |2 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|4 ++-- arch/arm/boot/dts/omap3-devkit8000.dts|4 ++-- arch/arm/boot/dts/omap3-evm.dts |4 ++-- arch/arm/boot/dts/omap3-igep.dtsi |4 ++-- arch/arm/boot/dts/omap3-igep0020.dts |2 +- arch/arm/boot/dts/omap3-igep0030.dts |2 +- arch/arm/boot/dts/omap3-overo.dtsi|4 ++-- arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 +- arch/arm/boot/dts/omap3430-sdp.dts|4 ++-- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts |4 ++-- arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-panda-es.dts |4 ++-- arch/arm/boot/dts/omap4-panda.dts |4 ++-- arch/arm/boot/dts/omap4-sdp-es23plus.dts |2 +- arch/arm/boot/dts/omap4-sdp.dts |6 +++--- arch/arm/boot/dts/omap4-var-som.dts |4 ++-- arch/arm/boot/dts/omap4.dtsi |2 +- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |2 +- arch/arm/boot/dts/omap5-evm.dts |4 ++-- arch/arm/boot/dts/omap5.dtsi |2 +- 29 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 37aa748..e6e4587 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,omap2430, ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts index 68282ee..224c08f 100644 --- a/arch/arm/boot/dts/omap2420-h4.dts +++ b/arch/arm/boot/dts/omap2420-h4.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap2420.dtsi +#include omap2420.dtsi / { model = TI OMAP2420 H4 board; diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index da5b285..c8f9c55 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index 054bc44..c535a5a 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2430, ti,omap2; diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 3046d1f..e0ce823 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap36xx.dtsi +#include omap36xx.dtsi / { model = TI OMAP3 BeagleBoard xM; @@ -75,7 +75,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi i2c2 { clock-frequency = 40; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 6eec699..fcac96a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 BeagleBoard; @@ -107,7 +107,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..8d0f5e4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TimLL OMAP3 Devkit8000; compatible = timll,omap3-devkit8000, ti,omap3; @@ -80,7 +80,7 @@ status = disabled; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index 96d1c20..d75759b 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 EVM (OMAP3530, AM/DM37x); @@ -44,7 +44,7 @@ }; }; -/include/ twl4030.dtsi
[PATCH v2 2/5] ARM: dts: OMAP2+: use existing constants for GPIOs
Use standard GPIO constants to enhance the readability of DT GPIOs. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap2.dtsi |2 ++ arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|6 +++--- arch/arm/boot/dts/omap3-devkit8000.dts|6 +++--- arch/arm/boot/dts/omap3-evm.dts |2 +- arch/arm/boot/dts/omap3-igep0020.dts |8 arch/arm/boot/dts/omap3-igep0030.dts |8 arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 ++ arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-sdp.dts | 16 arch/arm/boot/dts/omap4.dtsi |2 ++ arch/arm/boot/dts/omap5.dtsi |2 ++ 13 files changed, 36 insertions(+), 28 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index e6e4587..f39b237 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,6 +8,8 @@ * kind, whether express or implied. */ +#include dt-bindings/gpio/gpio.h + #include skeleton.dtsi / { diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index e0ce823..1e580d9 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -29,13 +29,13 @@ heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index fcac96a..434288f 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -28,18 +28,18 @@ compatible = gpio-leds; pmu_stat { label = beagleboard::pmu_stat; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ }; heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = gpio5 22 GPIO_ACTIVE_HIGH; /* 150 - D6 LED */ linux,default-trigger = heartbeat; }; mmc { label = beagleboard::usr1; - gpios = gpio5 21 0; /* 149 - D7 LED */ + gpios = gpio5 21 GPIO_ACTIVE_HIGH; /* 149 - D7 LED */ linux,default-trigger = mmc0; }; }; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8d0f5e4..5be71b1 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -22,21 +22,21 @@ heartbeat { label = devkit8000::led1; - gpios = gpio6 26 0; /* 186 - LED1 */ + gpios = gpio6 26 GPIO_ACTIVE_HIGH; /* 186 - LED1 */ default-state = on; linux,default-trigger = heartbeat; }; mmc { label = devkit8000::led2; - gpios = gpio6 3 0; /* 163 - LED2 */ + gpios = gpio6 3 GPIO_ACTIVE_HIGH;/* 163 - LED2 */ default-state = on; linux,default-trigger = none; }; usr { label = devkit8000::led3; - gpios = gpio6 4 0; /* 164 - LED3 */ + gpios = gpio6 4 GPIO_ACTIVE_HIGH;/* 164 - LED3 */ default-state = on; linux,default-trigger = usr; }; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index d75759b..baa24bb 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -28,7 +28,7 @@ compatible = gpio-leds; ledb { label = omap3evm::ledb; - gpios = twl_gpio 19 0; /* LEDB */ + gpios = twl_gpio 19 GPIO_ACTIVE_HIGH; /* LEDB */ linux,default-trigger = default-on; }; }; diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020
[PATCH v2 3/5] ARM: dts: OMAP4/5: use existing constants for IRQs
Use the constants defined in include/dt-bindings/interrupt-controller/ to enhance readability. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap4-panda-common.dtsi |8 +- arch/arm/boot/dts/omap4-sdp.dts |6 +- arch/arm/boot/dts/omap4-var-som.dts |4 +- arch/arm/boot/dts/omap4.dtsi | 113 ++- arch/arm/boot/dts/omap4460.dtsi |4 +- arch/arm/boot/dts/omap5.dtsi | 121 +++-- 6 files changed, 129 insertions(+), 127 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index a3ef2bd..16b03fd 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -145,16 +145,16 @@ twl: twl@48 { reg = 0x48; - /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + /* IRQ# = 7 */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; twl6040: twl@4b { compatible = ti,twl6040; reg = 0x4b; - /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + /* IRQ# = 119 */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts index 564d19b..509e27c 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts @@ -286,7 +286,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; @@ -294,7 +294,7 @@ compatible = ti,twl6040; reg = 0x4b; /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = 0 119 4; /* IRQ_SYS_2N cascaded to gic */ + interrupts = GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = gic; ti,audpwron-gpio = gpio4 31 0; /* gpio line 127 */ @@ -375,7 +375,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio2; - interrupts = 2 8; /* gpio line 34, low triggered */ + interrupts = 2 IRQ_TYPE_LEVEL_LOW; /* gpio line 34, low triggered */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4-var-som.dts b/arch/arm/boot/dts/omap4-var-som.dts index 6593607..135ba45 100644 --- a/arch/arm/boot/dts/omap4-var-som.dts +++ b/arch/arm/boot/dts/omap4-var-som.dts @@ -34,7 +34,7 @@ twl: twl@48 { reg = 0x48; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */ + interrupts = GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = gic; }; }; @@ -68,7 +68,7 @@ spi-max-frequency = 2400; reg = 0; interrupt-parent = gpio6; - interrupts = 11 8; /* gpio line 171, low triggered */ + interrupts = 11 IRQ_TYPE_LEVEL_LOW; /* gpio line 171, low triggered */ vdd-supply = vdd_eth; }; }; diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 00f6ab9..d4304a2 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -15,6 +15,7 @@ /memreserve/ 0x9d00 0x0300; #include dt-bindings/gpio/gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h #include skeleton.dtsi @@ -58,7 +59,7 @@ local-timer@0x48240600 { compatible = arm,cortex-a9-twd-timer; reg = 0x48240600 0x20; - interrupts = 1 13 0x304; + interrupts = GIC_PPI 13 (GIC_CPU_MASK_RAW(3) | IRQ_TYPE_LEVEL_HIGH); }; /* @@ -99,8 +100,8 @@ reg = 0x4400 0x1000, 0x4480 0x2000, 0x4500 0x1000; - interrupts = 0 9 0x4, -0 10 0x4; + interrupts = GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH; counter32k: counter@4a304000 { compatible = ti,omap-counter32k
[PATCH v2 4/5] ARM: dts: OMAP2+: header file for pinctrl constants
Most of the constants are taken from arch/arm/mach-omap2/mux.h. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/pinctrl/omap.h | 54 1 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h new file mode 100644 index 000..253ce95 --- /dev/null +++ b/include/dt-bindings/pinctrl/omap.h @@ -0,0 +1,54 @@ +/* + * This header provides constants for OMAP pinctrl bindings. + * + * Copyright (C) 2009 Nokia + * Copyright (C) 2009-2010 Texas Instruments + */ + +/* 34xx mux mode options for each pin. See TRM for options */ +#define OMAP_MUX_MODE0 0 +#define OMAP_MUX_MODE1 1 +#define OMAP_MUX_MODE2 2 +#define OMAP_MUX_MODE3 3 +#define OMAP_MUX_MODE4 4 +#define OMAP_MUX_MODE5 5 +#define OMAP_MUX_MODE6 6 +#define OMAP_MUX_MODE7 7 + +/* 24xx/34xx mux bit defines */ +#define OMAP_PULL_ENA (1 3) +#define OMAP_PULL_UP (1 4) +#define OMAP_ALTELECTRICALSEL (1 5) + +/* 34xx specific mux bit defines */ +#define OMAP_INPUT_EN (1 8) +#define OMAP_OFF_EN(1 9) +#define OMAP_OFFOUT_EN (1 10) +#define OMAP_OFFOUT_VAL(1 11) +#define OMAP_OFF_PULL_EN (1 12) +#define OMAP_OFF_PULL_UP (1 13) +#define OMAP_WAKEUP_EN (1 14) + +/* 44xx specific mux bit defines */ +#define OMAP_WAKEUP_EVENT (1 15) + +/* Active pin states */ +#define OMAP_PIN_OUTPUT0 +#define OMAP_PIN_OUTPUT_PULLUP (OMAP_PIN_OUTPUT | OMAP_PULL_ENA \ + | OMAP_PULL_UP) +#define OMAP_PIN_OUTPUT_PULLDOWN (OMAP_PIN_OUTPUT | OMAP_PULL_ENA) +#define OMAP_PIN_INPUT OMAP_INPUT_EN +#define OMAP_PIN_INPUT_PULLUP (OMAP_PULL_ENA | OMAP_INPUT_EN \ + | OMAP_PULL_UP) +#define OMAP_PIN_INPUT_PULLDOWN(OMAP_PULL_ENA | OMAP_INPUT_EN) + +/* Off mode states */ +#define OMAP_PIN_OFF_NONE 0 +#define OMAP_PIN_OFF_OUTPUT_HIGH (OMAP_OFF_EN | OMAP_OFFOUT_EN \ + | OMAP_OFFOUT_VAL) +#define OMAP_PIN_OFF_OUTPUT_LOW(OMAP_OFF_EN | OMAP_OFFOUT_EN) +#define OMAP_PIN_OFF_INPUT_PULLUP (OMAP_OFF_EN | OMAP_OFF_PULL_EN \ + | OMAP_OFF_PULL_UP) +#define OMAP_PIN_OFF_INPUT_PULLDOWN(OMAP_OFF_EN | OMAP_OFF_PULL_EN) +#define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN + -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH v2 5/5] ARM: dts: OMAP2+: use pinctrl constants
Using constants for pinctrl allows a better readability, and remove redundancy with comments. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap2.dtsi |1 + arch/arm/boot/dts/omap3-beagle.dts| 24 arch/arm/boot/dts/omap3-igep.dtsi | 32 +- arch/arm/boot/dts/omap3.dtsi |1 + arch/arm/boot/dts/omap4-panda-a4.dts |6 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 50 arch/arm/boot/dts/omap4-panda-es.dts |6 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |6 +- arch/arm/boot/dts/omap4-sdp.dts | 94 ++-- arch/arm/boot/dts/omap4.dtsi |1 + arch/arm/boot/dts/omap5-evm.dts | 88 +- arch/arm/boot/dts/omap5.dtsi |1 + 12 files changed, 157 insertions(+), 153 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index f39b237..b3cc896 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -9,6 +9,7 @@ */ #include dt-bindings/gpio/gpio.h +#include dt-bindings/pinctrl/omap.h #include skeleton.dtsi diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 434288f..2518e6a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk */ + 0x5c2 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp */ + 0x5c4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir */ + 0x5c6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt */ + 0x5c8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 */ + 0x5cA (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 */ + 0x1a4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 */ + 0x1a6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 */ + 0x1a8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 */ + 0x1aa (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 */ + 0x1ac (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 */ + 0x1ae (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 */ ; }; }; diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index 54588b0..6211564 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi @@ -29,37 +29,37 @@ omap3_pmx_core { uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = - 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */ - 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */ + 0x152 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* uart1_rx.uart1_rx */ + 0x14c (OMAP_PIN_OUTPUT
[PATCH] ARM: dts: OMAP4. fix missing omap4-sdp-es23plus.dtb in dtbs target
When making the dtbs target, omap4-sdp-es23plus.dtb is not built. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/Makefile |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b9f7121..d55cb26 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -149,6 +149,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ omap4-panda-es.dtb \ omap4-var-som.dtb \ omap4-sdp.dtb \ + omap4-sdp-es23plus.dtb \ omap5-evm.dtb \ am335x-evm.dtb \ am335x-evmsk.dtb \ -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/5] ARM: dts: OMAP2+: use preprocessor for device trees
Hello, Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability. Patch 2 creates a header file to define the OMAP_GPIO() macro, used by patch 3 to make GPIOs more readable. Likewise patch 5 uses the existing constants to make IRQs more readable. Patch 4 is a small random fix. This series was boot-tested on omap3-tobi. For other targets, the decompiled .dtb were diff'ed before and after applying the series to guarantee identity. Best regards, Florian [1] https://patchwork.kernel.org/patch/2560091/ Florian Vaussard (5): ARM: dts: OMAP2+: use #include for all device trees ARM: dts: OMAP2+: create a DT header for GPIO ARM: dts: OMAP2+: convert DT files to use the new OMAP_GPIO macro ARM: dts: OMAP3: fix incorrect notation for musb-hdrc interrupt ARM: dts: OMAP4/5: use existing constants for IRQs arch/arm/boot/dts/omap2.dtsi |4 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |8 +- arch/arm/boot/dts/omap3-beagle.dts| 10 +- arch/arm/boot/dts/omap3-devkit8000.dts| 10 +- arch/arm/boot/dts/omap3-evm.dts |4 +- arch/arm/boot/dts/omap3-igep.dtsi |4 +- arch/arm/boot/dts/omap3-igep0020.dts |8 +- arch/arm/boot/dts/omap3-igep0030.dts |4 +- arch/arm/boot/dts/omap3-overo.dtsi|4 +- arch/arm/boot/dts/omap3-tobi.dts |4 +- arch/arm/boot/dts/omap3.dtsi |6 +- arch/arm/boot/dts/omap3430-sdp.dts|4 +- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts |4 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 18 +- arch/arm/boot/dts/omap4-panda-es.dts |4 +- arch/arm/boot/dts/omap4-panda.dts |4 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts |2 +- arch/arm/boot/dts/omap4-sdp.dts | 32 ++-- arch/arm/boot/dts/omap4-var-som.dts |8 +- arch/arm/boot/dts/omap4.dtsi | 117 ++-- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |6 +- arch/arm/boot/dts/omap5-evm.dts |4 +- arch/arm/boot/dts/omap5.dtsi | 125 +++-- include/dt-bindings/gpio/omap-gpio.h | 289 + 30 files changed, 497 insertions(+), 198 deletions(-) create mode 100644 include/dt-bindings/gpio/omap-gpio.h -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 1/5] ARM: dts: OMAP2+: use #include for all device trees
Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap2.dtsi |2 +- arch/arm/boot/dts/omap2420-h4.dts |2 +- arch/arm/boot/dts/omap2420.dtsi |2 +- arch/arm/boot/dts/omap2430.dtsi |2 +- arch/arm/boot/dts/omap3-beagle-xm.dts |4 ++-- arch/arm/boot/dts/omap3-beagle.dts|4 ++-- arch/arm/boot/dts/omap3-devkit8000.dts|4 ++-- arch/arm/boot/dts/omap3-evm.dts |4 ++-- arch/arm/boot/dts/omap3-igep.dtsi |4 ++-- arch/arm/boot/dts/omap3-igep0020.dts |2 +- arch/arm/boot/dts/omap3-igep0030.dts |2 +- arch/arm/boot/dts/omap3-overo.dtsi|4 ++-- arch/arm/boot/dts/omap3-tobi.dts |2 +- arch/arm/boot/dts/omap3.dtsi |2 +- arch/arm/boot/dts/omap3430-sdp.dts|4 ++-- arch/arm/boot/dts/omap34xx.dtsi |2 +- arch/arm/boot/dts/omap36xx.dtsi |2 +- arch/arm/boot/dts/omap4-panda-a4.dts |4 ++-- arch/arm/boot/dts/omap4-panda-common.dtsi |4 ++-- arch/arm/boot/dts/omap4-panda-es.dts |4 ++-- arch/arm/boot/dts/omap4-panda.dts |4 ++-- arch/arm/boot/dts/omap4-sdp-es23plus.dts |2 +- arch/arm/boot/dts/omap4-sdp.dts |6 +++--- arch/arm/boot/dts/omap4-var-som.dts |4 ++-- arch/arm/boot/dts/omap4.dtsi |2 +- arch/arm/boot/dts/omap443x.dtsi |2 +- arch/arm/boot/dts/omap4460.dtsi |2 +- arch/arm/boot/dts/omap5-evm.dts |4 ++-- arch/arm/boot/dts/omap5.dtsi |2 +- 29 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 37aa748..e6e4587 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ skeleton.dtsi +#include skeleton.dtsi / { compatible = ti,omap2430, ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts index 68282ee..224c08f 100644 --- a/arch/arm/boot/dts/omap2420-h4.dts +++ b/arch/arm/boot/dts/omap2420-h4.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap2420.dtsi +#include omap2420.dtsi / { model = TI OMAP2420 H4 board; diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index da5b285..c8f9c55 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2420, ti,omap2; diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index 054bc44..c535a5a 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi @@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ omap2.dtsi +#include omap2.dtsi / { compatible = ti,omap2430, ti,omap2; diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 3046d1f..e0ce823 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap36xx.dtsi +#include omap36xx.dtsi / { model = TI OMAP3 BeagleBoard xM; @@ -75,7 +75,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi i2c2 { clock-frequency = 40; diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts index 6eec699..fcac96a 100644 --- a/arch/arm/boot/dts/omap3-beagle.dts +++ b/arch/arm/boot/dts/omap3-beagle.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 BeagleBoard; @@ -107,7 +107,7 @@ }; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..8d0f5e4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TimLL OMAP3 Devkit8000; compatible = timll,omap3-devkit8000, ti,omap3; @@ -80,7 +80,7 @@ status = disabled; }; -/include/ twl4030.dtsi +#include twl4030.dtsi mmc1 { vmmc-supply = vmmc1; diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts index 96d1c20..d75759b 100644 --- a/arch/arm/boot/dts/omap3-evm.dts +++ b/arch/arm/boot/dts/omap3-evm.dts @@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ omap34xx.dtsi +#include omap34xx.dtsi / { model = TI OMAP3 EVM (OMAP3530, AM/DM37x); @@ -44,7 +44,7 @@ }; }; -/include/ twl4030.dtsi
[PATCH 2/5] ARM: dts: OMAP2+: create a DT header for GPIO
Define the OMAP_GPIO macro to conveniently use GPIO inside OMAP DT. For example: gpios = gpio6 3 0; /* GPIO 163 */ can be replaced by gpios = OMAP_GPIO(163, 0); Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- include/dt-bindings/gpio/omap-gpio.h | 289 ++ 1 files changed, 289 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/gpio/omap-gpio.h diff --git a/include/dt-bindings/gpio/omap-gpio.h b/include/dt-bindings/gpio/omap-gpio.h new file mode 100644 index 000..64f2686 --- /dev/null +++ b/include/dt-bindings/gpio/omap-gpio.h @@ -0,0 +1,289 @@ +/* + * This header provides macros and constants for binding ti,omap*-gpio + * + * Compatible with OMAP2, OMAP3, OMAP4 and OMAP5. + */ + +#ifndef _DT_BINDINGS_GPIO_OMAP_GPIO_H +#define _DT_BINDINGS_GPIO_OMAP_GPIO_H + +#include dt-bindings/gpio/gpio.h + +#define OMAP_GPIO_0_BANKgpio1 +#define OMAP_GPIO_1_BANKgpio1 +#define OMAP_GPIO_2_BANKgpio1 +#define OMAP_GPIO_3_BANKgpio1 +#define OMAP_GPIO_4_BANKgpio1 +#define OMAP_GPIO_5_BANKgpio1 +#define OMAP_GPIO_6_BANKgpio1 +#define OMAP_GPIO_7_BANKgpio1 +#define OMAP_GPIO_8_BANKgpio1 +#define OMAP_GPIO_9_BANKgpio1 +#define OMAP_GPIO_10_BANK gpio1 +#define OMAP_GPIO_11_BANK gpio1 +#define OMAP_GPIO_12_BANK gpio1 +#define OMAP_GPIO_13_BANK gpio1 +#define OMAP_GPIO_14_BANK gpio1 +#define OMAP_GPIO_15_BANK gpio1 +#define OMAP_GPIO_16_BANK gpio1 +#define OMAP_GPIO_17_BANK gpio1 +#define OMAP_GPIO_18_BANK gpio1 +#define OMAP_GPIO_19_BANK gpio1 +#define OMAP_GPIO_20_BANK gpio1 +#define OMAP_GPIO_21_BANK gpio1 +#define OMAP_GPIO_22_BANK gpio1 +#define OMAP_GPIO_23_BANK gpio1 +#define OMAP_GPIO_24_BANK gpio1 +#define OMAP_GPIO_25_BANK gpio1 +#define OMAP_GPIO_26_BANK gpio1 +#define OMAP_GPIO_27_BANK gpio1 +#define OMAP_GPIO_28_BANK gpio1 +#define OMAP_GPIO_29_BANK gpio1 +#define OMAP_GPIO_30_BANK gpio1 +#define OMAP_GPIO_31_BANK gpio1 + +#define OMAP_GPIO_32_BANK gpio2 +#define OMAP_GPIO_33_BANK gpio2 +#define OMAP_GPIO_34_BANK gpio2 +#define OMAP_GPIO_35_BANK gpio2 +#define OMAP_GPIO_36_BANK gpio2 +#define OMAP_GPIO_37_BANK gpio2 +#define OMAP_GPIO_38_BANK gpio2 +#define OMAP_GPIO_39_BANK gpio2 +#define OMAP_GPIO_40_BANK gpio2 +#define OMAP_GPIO_41_BANK gpio2 +#define OMAP_GPIO_42_BANK gpio2 +#define OMAP_GPIO_43_BANK gpio2 +#define OMAP_GPIO_44_BANK gpio2 +#define OMAP_GPIO_45_BANK gpio2 +#define OMAP_GPIO_46_BANK gpio2 +#define OMAP_GPIO_47_BANK gpio2 +#define OMAP_GPIO_48_BANK gpio2 +#define OMAP_GPIO_49_BANK gpio2 +#define OMAP_GPIO_50_BANK gpio2 +#define OMAP_GPIO_51_BANK gpio2 +#define OMAP_GPIO_52_BANK gpio2 +#define OMAP_GPIO_53_BANK gpio2 +#define OMAP_GPIO_54_BANK gpio2 +#define OMAP_GPIO_55_BANK gpio2 +#define OMAP_GPIO_56_BANK gpio2 +#define OMAP_GPIO_57_BANK gpio2 +#define OMAP_GPIO_58_BANK gpio2 +#define OMAP_GPIO_59_BANK gpio2 +#define OMAP_GPIO_60_BANK gpio2 +#define OMAP_GPIO_61_BANK gpio2 +#define OMAP_GPIO_62_BANK gpio2 +#define OMAP_GPIO_63_BANK gpio2 + +#define OMAP_GPIO_64_BANK gpio3 +#define OMAP_GPIO_65_BANK gpio3 +#define OMAP_GPIO_66_BANK gpio3 +#define OMAP_GPIO_67_BANK gpio3 +#define OMAP_GPIO_68_BANK gpio3 +#define OMAP_GPIO_69_BANK gpio3 +#define OMAP_GPIO_70_BANK gpio3 +#define OMAP_GPIO_71_BANK gpio3 +#define OMAP_GPIO_72_BANK gpio3 +#define OMAP_GPIO_73_BANK gpio3 +#define OMAP_GPIO_74_BANK gpio3 +#define OMAP_GPIO_75_BANK gpio3 +#define OMAP_GPIO_76_BANK gpio3 +#define OMAP_GPIO_77_BANK gpio3 +#define OMAP_GPIO_78_BANK gpio3 +#define OMAP_GPIO_79_BANK gpio3 +#define OMAP_GPIO_80_BANK gpio3 +#define OMAP_GPIO_81_BANK gpio3 +#define OMAP_GPIO_82_BANK gpio3 +#define OMAP_GPIO_83_BANK gpio3 +#define OMAP_GPIO_84_BANK gpio3 +#define OMAP_GPIO_85_BANK gpio3 +#define OMAP_GPIO_86_BANK gpio3 +#define OMAP_GPIO_87_BANK gpio3 +#define OMAP_GPIO_88_BANK gpio3 +#define OMAP_GPIO_89_BANK gpio3 +#define OMAP_GPIO_90_BANK gpio3 +#define OMAP_GPIO_91_BANK gpio3 +#define OMAP_GPIO_92_BANK gpio3 +#define OMAP_GPIO_93_BANK gpio3 +#define OMAP_GPIO_94_BANK gpio3 +#define OMAP_GPIO_95_BANK gpio3 + +#define OMAP_GPIO_96_BANK gpio4 +#define OMAP_GPIO_97_BANK gpio4 +#define OMAP_GPIO_98_BANK gpio4 +#define OMAP_GPIO_99_BANK gpio4 +#define OMAP_GPIO_100_BANK gpio4 +#define OMAP_GPIO_101_BANK gpio4 +#define OMAP_GPIO_102_BANK gpio4 +#define OMAP_GPIO_103_BANK gpio4 +#define OMAP_GPIO_104_BANK gpio4
[PATCH 4/5] ARM: dts: OMAP3: fix incorrect notation for musb-hdrc interrupt
On OMAP3, the INTC interrupt controller has only 1 cell. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3.dtsi |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 15049b8..0f3be20 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -518,7 +518,7 @@ usb_otg_hs: usb_otg_hs@480ab000 { compatible = ti,omap3-musb; reg = 0x480ab000 0x1000; - interrupts = 0 92 0x4, 0 93 0x4; + interrupts = 92, 93; interrupt-names = mc, dma; ti,hwmods = usb_otg_hs; multipoint = 1; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/5] ARM: dts: OMAP2+: use #include for all device trees
Hi Tony, On 05/22/2013 05:40 PM, Tony Lindgren wrote: * Florian Vaussard florian.vauss...@epfl.ch [130522 07:33]: Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible. This is good, but let's use it with case. Probably the best use for this right now is to add defines for the mux modes from mach-omap2/mux.h as that makes the raw values readable without comments. I think that one first good case is the IRQs in patch 5. But I agree, adding defines for the mux modes would be great. I can have a look at it for a v2. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 2/5] ARM: dts: OMAP2+: create a DT header for GPIO
Hello Stephan, Tony, Thank you for your reviews. On 05/22/2013 05:34 PM, Tony Lindgren wrote: * Stephen Warren swar...@wwwdotorg.org [130522 08:32]: On 05/22/2013 08:27 AM, Florian Vaussard wrote: Define the OMAP_GPIO macro to conveniently use GPIO inside OMAP DT. For example: gpios = gpio6 3 0; /* GPIO 163 */ can be replaced by gpios = OMAP_GPIO(163, 0); diff --git a/include/dt-bindings/gpio/omap-gpio.h b/include/dt-bindings/gpio/omap-gpio.h +#define OMAP_GPIO_0_BANKgpio1 +#define OMAP_GPIO_1_BANKgpio1 +#define OMAP_GPIO_2_BANKgpio1 +#define OMAP_GPIO_3_BANKgpio1 There are a /lot/ of those. Is this really worth it? If the OMAP GPIO HW is already represented as a bunch of separate DT nodes which represent separate GPIO blocks, then I would have thought the syntax gpioN M 0 more directly represents what would be found in the HW manual? If not, surely the DT should have a single node to represent a single GPIO controller, which just happens to internally support a bunch of register arrays. Yes I agree, let's not go back to numbering anything except within the a single instance. If anything, we can put the gpio number into comments. From a board point a view, I consider this macro as being easier to use, than having to perform the necessary arithmetic to get the bank + offset for each GPIO when converting existing boards or developing new ones. But I also agree with you, and I was sad not to find a more elegant way. Maybe someone with better preprocessor skills could come up with a better solution? Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 3/5] ARM: dts: OMAP2+: convert DT files to use the new OMAP_GPIO macro
Hi Stepen, Thank you for your review, On 05/22/2013 05:28 PM, Stephen Warren wrote: On 05/22/2013 08:27 AM, Florian Vaussard wrote: Use OMAP_GPIO(), in conjunction with standard GPIO flags, to enhance the readability of DT GPIOs. diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index e0ce823..e773a5e 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts @@ -29,13 +29,13 @@ heartbeat { label = beagleboard::usr0; - gpios = gpio5 22 0; /* 150 - D6 LED */ + gpios = OMAP_GPIO(150, GPIO_ACTIVE_HIGH); /* 150 - D6 LED */ One of the advantages of cpp support for me is the ability to remove the redundant part of the command. In other words, perhaps remove the 150 - since that information is part of the OMAP_GPIO() call, leaving just /* D6 LED */. I might have expected D6 to be the label too, thus removing any need for the comment. I agree. I removed almost all the comments from the other files. For here, I would leave /* D6 LED */ as you suggest. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 0/9] ARM: dts: Various OMAP2+ device-tree updates
Hi Benoit, On 03/14/2013 03:57 PM, Benoit Cousson wrote: Salut Jon, On 03/08/2013 06:27 PM, Jon Hunter wrote: Various OMAP device-tree updates for PMU, DMA, GPIO, GPMC and boards. The DMA, PMU and OMAP3430 SDP board changes have been sent before individually but re-sending here as a complete series for v3.10. This is based upon v3.9-rc1 and the OMAP3 GPMC binding from Florian Vaussard [1] and OMAP5 DT SPI patch from Felipe Balbi [2]. [1] https://patchwork.kernel.org/patch/2057111/ I've tried to follow the series review, and it seems that Florian was considering sending some other patches. It is not clear if this is a new version of the series or some additional patches. Concerning patch [1], it can be merged to add the GPMC binding for OMAP3. But please discard the rest of my original series, I will repost something later. Regards, Florian I still did not merge this series wondering what to do with it. Felipe's patch on this other hand is already applied in my branch. Regards, Benoit [2] https://patchwork.kernel.org/patch/2134711/ Jon Hunter (9): ARM: OMAP2+: Prepare for device-tree PMU support ARM: dts: OMAP2+: Add PMU nodes ARM: dts: OMAP2+: Add SDMA controller bindings and nodes ARM: dts: OMAP3: Add support for OMAP3430 SDP board ARM: dts: Add GPMC node for OMAP2, OMAP4 and OMAP5 ARM: dts: Add OMAP3430 SDP flash memory bindings ARM: dts: Add OMAP2 gpio bindings ARM: dts: OMAP3+: Correct gpio #interrupts-cells property ARM: dts: OMAP3: Add reg and interrupt properties for gpio .../devicetree/bindings/dma/omap-sdma.txt | 51 +++ arch/arm/boot/dts/Makefile |1 + arch/arm/boot/dts/omap2.dtsi | 17 +++ arch/arm/boot/dts/omap2420.dtsi| 55 arch/arm/boot/dts/omap2430.dtsi| 66 + arch/arm/boot/dts/omap3.dtsi | 70 +- arch/arm/boot/dts/omap3430-sdp.dts | 141 arch/arm/boot/dts/omap4-panda-es.dts |2 + arch/arm/boot/dts/omap4.dtsi | 64 - arch/arm/boot/dts/omap4460.dtsi| 18 +++ arch/arm/boot/dts/omap5.dtsi | 68 -- arch/arm/mach-omap2/pmu.c | 14 +- 12 files changed, 544 insertions(+), 23 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt create mode 100644 arch/arm/boot/dts/omap3430-sdp.dts create mode 100644 arch/arm/boot/dts/omap4460.dtsi ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 0/2] ARM: dts: omap3-overo: Add pwm-leds and audio support
Hi, On 02/07/2013 08:58 AM, Peter Ujfalusi wrote: Hi, On 02/06/2013 02:30 PM, Benoit Cousson wrote: So a patch is being merged to handle triggers in the case of pwm leds [1]. When done, we will be able to add back the default trigger. Do you want to wait on it to merge this series? What kind of dependency do we have between these two series? I mean what will happen if the DTS is merged before the pwm subsystem? If that does not generate any regression / crash, then it is OK, if not, we should take care of the order. In this series the 'linux,default-trigger' property is not added to the pwm-leds node, so it is safe to take this series. I'm sure Florian will send the update to add this flag back for 3.10 or for 3.9-rc (the needed patches for PWM and leds-pwm will be in 3.9). Yes, it is safe to take this series. I will provide a patch to add back the trigger when it is safe to. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: OMAP3: Add GPMC controller
Hi Javier, On 02/04/2013 12:57 PM, Javier Martinez Canillas wrote: [...] Yes, I saw on the list that Tony asked you too extend the GPMC DT support. Flash support is on my TODO list too but I don't know if I'm going to have time to work on this in the next few weeks. Since you are thinking to change the binding, there is something I want to discuss with you. We have two different version for each IGEP board, one that uses NAND memory and another that has OneNAND. With board files this is easy because the flash memory type is hardcoded (in hardware) using sysboot pins [3]. So we check the sysboot value and call board_nand_init() or board_onenand_init() accordingly and pass the same static struct mtd_partition igep_flash_partitions[] in both cases. But with DT this is a little bit trickier since you have to define either a nand@0 or onenand@0 child node for the gpmc device node. So, we will have to create lots of dts and dtsi to handle each combination (IGEPv2 + NAND, IGEPv2 + OneNAND, IGEP COM + NAND, etc). I wonder if we could just have a generic gpmc-flash binding and maybe use a gpmc, flash_type property or something like that to decide if gpmc_onenand_init() or gpmc_nand_init() has to be called. This boils down to the problem where you have an if statement in your board file, and I think no general solution exists. In your suggestion, having a property will force you anyway to write distinct DT files to account for the two versions, so it won't really help if I understand correctly. We would need conditional section inside device trees, at least to test for simple parameters. Or a way to generate several DT blobs based on a single DT source file. Another hackish solution would be to write a meta component, whose probe section would do your test. But this is just a stripped down version of the board file, far from being generic... I will think on it during my holidays :) Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 0/2] ARM: dts: OMAP3: Add GPMC controller and NAND memory to Overo
So how should we handle such case? Having several dtsi depending on the Overo's revision would be a mess to my sense, considering the non-conditional include inside the expansion boards' dts. Or would it make sense to extend the DT binding for partitions? Yes makes sense to extend the binding to use the full flash memory if the size can be probed. Ok, I will see for a patch soon (i.e. in the coming weeks). Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 0/2] ARM: dts: omap3-overo: Add pwm-leds and audio support
Hello Benoit, On 01/24/2013 01:21 PM, Benoit Cousson wrote: + Peter who did the original PWM Hi Florian, On 01/23/2013 06:56 PM, Florian Vaussard wrote: Hello Benoit, This patchset adds some new DT supports to the Overo products. The first patch converts the PMIC LEDB output to use the pwm-leds, newly merged in your branch for_3.9/dts. The second patch adds the audio support. Excellent, that looks very good to me, but I'd like to get the feedback from Peter before merging it. So a patch is being merged to handle triggers in the case of pwm leds [1]. When done, we will be able to add back the default trigger. Do you want to wait on it to merge this series? Regards, Florian [1] https://patchwork.kernel.org/patch/2056191/ ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: OMAP3: Add GPMC controller
Hi Javier, On 02/04/2013 10:27 AM, Javier Martinez Canillas wrote: Hi Florian, On Mon, Jan 28, 2013 at 6:54 PM, Florian Vaussard florian.vauss...@epfl.ch wrote: Add device-tree support for the GPMC controller on the OMAP3. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3.dtsi | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 6c63118..2ddae38 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -403,5 +403,16 @@ ti,timer-alwon; ti,timer-secure; }; + + gpmc: gpmc@6e00 { + compatible = ti,omap3430-gpmc; + ti,hwmods = gpmc; + reg = 0x6e00 0x100; + interrupts = 20; + gpmc,num-cs = 8; + gpmc,num-waitpins = 4; + #address-cells = 2; + #size-cells = 1; + }; }; }; I had the same patch on a tree I was working on to add DT support for gpmc-smsc911x on an OMAP3 board but I was waiting for Daniel's patches to hit mainline before sending the RFC. So please feel free to add: Reviewed-by: Javier Martinez Canillas javier.marti...@collabora.co.uk Great, the smsc911x was on my TODO list, I can cross it out :) BTW, do you have a public git for this, so I can test your work on my setup? For the GPMC support, I will have to make a few more more as discussed with Tony, and as I will be away for more than 2 weeks, feel free to go ahead before me. This patchset was only at an RFC stage. Regards, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 2/2] ARM: dts: OMAP3: Add NAND memory for Overo products
Add device-tree support for the on-board NAND memory, with corresponding partitions. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3-overo.dtsi | 49 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index 81341fa..0efd6f3 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -33,6 +33,55 @@ }; }; +gpmc { + ranges = 0 0 0x3000 0x0004; /* CS0: NAND */ + + nand@0 { + reg = 0 0 0; /* CS0, offset 0 */ + + nand-bus-width = 16; + ti,nand-ecc-opt = sw; + + gpmc,sync-clk = 0; + gpmc,cs-on = 0; + gpmc,cs-rd-off = 36; + gpmc,cs-wr-off = 36; + gpmc,adv-on = 6; + gpmc,adv-rd-off = 24; + gpmc,adv-wr-off = 36; + gpmc,we-off = 30; + gpmc,oe-off = 48; + gpmc,access = 54; + gpmc,rd-cycle = 72; + gpmc,wr-cycle = 72; + gpmc,wr-access = 30; + gpmc,wr-data-mux-bus = 0; + + #address-cells = 1; + #size-cells = 1; + + xloader@0 { + reg = 0x 0x0008; + }; + + uboot@8 { + reg = 0x0008 0x001c; + }; + + ubootenv@24 { + reg = 0x0024 0x0004; + }; + + linux@28 { + reg = 0x0028 0x0040; + }; + + rootfs@68 { + reg = 0x0068 0x1f98; /* 500 MB */ + }; + }; +}; + i2c1 { clock-frequency = 260; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 0/2] ARM: dts: OMAP3: Add GPMC controller and NAND memory to Overo
Hello, This is more an RFC serie, as an issue is still unclear to me. Building on the work of Daniel Mack for the GPMC controller (staged in Tony's tree [1]), it was easy to add the GPMC controller to OMAP3. The issue comes from the Overo on-board NAND, as the amount of flash depends on the revision. Currently, partitions are handled in the board file using MTDPART_SIZ_FULL, but looking at the ofpart parser, the size given to the parser must be fixed. So how should we handle such case? Having several dtsi depending on the Overo's revision would be a mess to my sense, considering the non-conditional include inside the expansion boards' dts. Or would it make sense to extend the DT binding for partitions? This serie was tested on an Overo with 512MB of NAND. Best regards, Florian [1] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git omap-for-v3.9/gpmc Florian Vaussard (2): ARM: dts: OMAP3: Add GPMC controller ARM: dts: OMAP3: Add NAND memory for Overo products arch/arm/boot/dts/omap3-overo.dtsi | 49 arch/arm/boot/dts/omap3.dtsi | 11 2 files changed, 60 insertions(+), 0 deletions(-) -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
[PATCH 1/2] ARM: dts: OMAP3: Add GPMC controller
Add device-tree support for the GPMC controller on the OMAP3. Signed-off-by: Florian Vaussard florian.vauss...@epfl.ch --- arch/arm/boot/dts/omap3.dtsi | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 6c63118..2ddae38 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -403,5 +403,16 @@ ti,timer-alwon; ti,timer-secure; }; + + gpmc: gpmc@6e00 { + compatible = ti,omap3430-gpmc; + ti,hwmods = gpmc; + reg = 0x6e00 0x100; + interrupts = 20; + gpmc,num-cs = 8; + gpmc,num-waitpins = 4; + #address-cells = 2; + #size-cells = 1; + }; }; }; -- 1.7.5.4 ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: omap3-overo: Add support for pwm-leds
We have two drivers at the moment: pwm-twl and pwm-twl-led. However new out of SoC PWM drivers might come (for example for palmas). So it worth take a look at some generic implementation. OK. So I have the series. I need to add few more things but pwm-leds on BeagleBoard works fine when I put the default_trigger for the pmustat LED to be mmc0. It is blinking happily ;) I'll CC you with the patches when I send them. I sent a patchset 2 hours ago with you in CC, you haven't received them? Cheers, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: omap3-overo: Add support for pwm-leds
Hi Peter, diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index 89808ce..800be29 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi @@ -14,12 +14,13 @@ /include/ omap3.dtsi / { - leds { - compatible = gpio-leds; + pwmleds { + compatible = pwm-leds; + overo { label = overo:blue:COM; - gpios = twl_gpio 19 0; - linux,default-trigger = mmc0; You can keep the default trigger for the pwm-leds as well. The best way to test this is on top of linux-next which already have the leds-pwm DT bindings. I did it at first, but the led API executes in atomic context, where the pwm-twl-led driver uses i2c communication. Setting a trigger will result in a kernel panic. I am working on a patch for pwm-twl-led to defer using a workqueue right now. Cheers, Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: omap3-overo: Add support for pwm-leds
I did it at first, but the led API executes in atomic context, where the pwm-twl-led driver uses i2c communication. Setting a trigger will result in a kernel panic. Now that you mentioned it, this might be true. [c0013204] (unwind_backtrace+0x0/0xec) from [c00348ac] (warn_slowpath_common+0x4c/0x64) [c00348ac] (warn_slowpath_common+0x4c/0x64) from [c00348e0] (warn_slowpath_null+0x1c/0x24) [c00348e0] (warn_slowpath_null+0x1c/0x24) from [c054d384] (__mutex_lock_slowpath+0x6c/0x26c) [c054d384] (__mutex_lock_slowpath+0x6c/0x26c) from [c054d590] (mutex_lock+0xc/0x20) [c054d590] (mutex_lock+0xc/0x20) from [c02d740c] (regmap_bulk_write+0x48/0x138) [c02d740c] (regmap_bulk_write+0x48/0x138) from [c02de2c0] (twl_i2c_write+0xa4/0xf0) [c02de2c0] (twl_i2c_write+0xa4/0xf0) from [c0299e34] (twl4030_pwmled_config+0x70/0x9c) [c0299e34] (twl4030_pwmled_config+0x70/0x9c) from [c029875c] (pwm_config+0x5c/0x6c) [c029875c] (pwm_config+0x5c/0x6c) from [c039dc04] (led_pwm_set+0x28/0x64) [c039dc04] (led_pwm_set+0x28/0x64) from [c039e27c] (led_heartbeat_function+0x10c/0x134) [c039e27c] (led_heartbeat_function+0x10c/0x134) from [c004359c] (call_timer_fn+0x90/0x178) [c004359c] (call_timer_fn+0x90/0x178) from [c0043994] (run_timer_softirq+0x250/0x2c8) [c0043994] (run_timer_softirq+0x250/0x2c8) from [c003cf78] (__do_softirq+0xf8/0x248) [c003cf78] (__do_softirq+0xf8/0x248) from [c003d154] (irq_exit+0x44/0x98) [c003d154] (irq_exit+0x44/0x98) from [c000e338] (handle_IRQ+0x68/0x8c) [c000e338] (handle_IRQ+0x68/0x8c) from [c000870c] (omap3_intc_handle_irq+0x58/0x70) [c000870c] (omap3_intc_handle_irq+0x58/0x70) from [c054f8c0] (__irq_svc+0x40/0x70) Exception stack(0xc077df60 to 0xc077dfa8) :-) I am working on a patch for pwm-twl-led to defer using a workqueue right now. Great! The only thing I worry about is the latency we are going to get with the workqueue. If the latency becomes critical, we can create our own workqueue. Do we merge anyway this patchset, or do we wait until the trigger has been fixed? Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [PATCH 1/2] ARM: dts: omap3-overo: Add support for pwm-leds
Hi I am working on a patch for pwm-twl-led to defer using a workqueue right now. Great! The only thing I worry about is the latency we are going to get with the workqueue. If the latency becomes critical, we can create our own workqueue. Hrm, when we handled the led via gpio-leds it was also going through the same path at the end, via i2c to twl4030. I think the fix for this is going to be needed in the pwm core level. Just need to look at the gpio code to have similar handling of might_sleep interfaces. You are right. But then the pwm core must provide a way to know if the pwm access function are callable from atomic context or not (the gpio framework provides gpio_cansleep()). This implies a good amount of changes to the pwm framework, and currently we are the only driver using non-atomic access. I will take a closer look to the complexity of this solution tomorrow. Florian ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss