[OpenWrt-Devel,V3,2/5] brcm63xx: prefer DT GPIOs over legacy
diff mbox

Message ID 54C52998.3060402@gmail.com
State Accepted
Delegated to: Jonas Gorski
Headers show

Commit Message

Álvaro Fernández Rojas Jan. 25, 2015, 5:36 p.m. UTC
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---

Comments

Jonas Gorski Feb. 27, 2015, 6:15 p.m. UTC | #1
On Sun, Jan 25, 2015 at 6:36 PM, Álvaro Fernández Rojas
<noltari@gmail.com> wrote:

I decided to not apply this and instead directly move the buttons/led
to the dts files and remove them from the board_info structs, so there
should be no conflict potential.


> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
> diff --git a/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch
> new file mode 100644
> index 0000000..f56c8ca
> --- /dev/null
> +++ b/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch
> @@ -0,0 +1,43 @@
> +--- a/arch/mips/bcm63xx/boards/board_common.c
> ++++ b/arch/mips/bcm63xx/boards/board_common.c
> +@@ -204,6 +204,10 @@ int __init board_register_devices(void)
> +       }
> + #endif
> +
> ++      if (!board_of_device_present("gpio0")) {
> ++              bcm63xx_gpio_init();
> ++      }
> ++
> +       if (board.has_uart0)
> +               bcm63xx_uart_register(0);
> +
> +@@ -269,7 +273,7 @@ int __init board_register_devices(void)
> +       while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
> +               led_count++;
> +
> +-      if (led_count) {
> ++      if (led_count && !board_of_device_present("gpio0")) {
> +               bcm63xx_led_data.num_leds = led_count;
> +               bcm63xx_led_data.leds = board.leds;
> +
> +@@ -284,7 +288,7 @@ int __init board_register_devices(void)
> +       while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
> +               button_count++;
> +
> +-      if (button_count) {
> ++      if (button_count && !board_of_device_present("gpio0")) {
> +               bcm63xx_gpio_keys_data.nbuttons = button_count;
> +               bcm63xx_gpio_keys_data.buttons = board.buttons;
> +
> +--- a/arch/mips/bcm63xx/prom.c
> ++++ b/arch/mips/bcm63xx/prom.c
> +@@ -54,9 +54,6 @@ void __init prom_init(void)
> +       reg &= ~mask;
> +       bcm_perf_writel(reg, PERF_CKCTL_REG);
> +
> +-      /* register gpiochip */
> +-      bcm63xx_gpio_init();
> +-
> +       /* detect and setup flash access */
> +       bcm63xx_flash_detect();
> +
> diff --git a/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch
> new file mode 100644
> index 0000000..f56c8ca
> --- /dev/null
> +++ b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch
> @@ -0,0 +1,43 @@
> +--- a/arch/mips/bcm63xx/boards/board_common.c
> ++++ b/arch/mips/bcm63xx/boards/board_common.c
> +@@ -204,6 +204,10 @@ int __init board_register_devices(void)
> +       }
> + #endif
> +
> ++      if (!board_of_device_present("gpio0")) {
> ++              bcm63xx_gpio_init();
> ++      }
> ++
> +       if (board.has_uart0)
> +               bcm63xx_uart_register(0);
> +
> +@@ -269,7 +273,7 @@ int __init board_register_devices(void)
> +       while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
> +               led_count++;
> +
> +-      if (led_count) {
> ++      if (led_count && !board_of_device_present("gpio0")) {
> +               bcm63xx_led_data.num_leds = led_count;
> +               bcm63xx_led_data.leds = board.leds;
> +
> +@@ -284,7 +288,7 @@ int __init board_register_devices(void)
> +       while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
> +               button_count++;
> +
> +-      if (button_count) {
> ++      if (button_count && !board_of_device_present("gpio0")) {
> +               bcm63xx_gpio_keys_data.nbuttons = button_count;
> +               bcm63xx_gpio_keys_data.buttons = board.buttons;
> +
> +--- a/arch/mips/bcm63xx/prom.c
> ++++ b/arch/mips/bcm63xx/prom.c
> +@@ -54,9 +54,6 @@ void __init prom_init(void)
> +       reg &= ~mask;
> +       bcm_perf_writel(reg, PERF_CKCTL_REG);
> +
> +-      /* register gpiochip */
> +-      bcm63xx_gpio_init();
> +-
> +       /* detect and setup flash access */
> +       bcm63xx_flash_detect();
> +
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Patch
diff mbox

diff --git a/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch
new file mode 100644
index 0000000..f56c8ca
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.14/377-DT-GPIO-over-legacy.patch
@@ -0,0 +1,43 @@ 
+--- a/arch/mips/bcm63xx/boards/board_common.c
++++ b/arch/mips/bcm63xx/boards/board_common.c
+@@ -204,6 +204,10 @@ int __init board_register_devices(void)
+ 	}
+ #endif
+ 
++	if (!board_of_device_present("gpio0")) {
++		bcm63xx_gpio_init();
++	}
++
+ 	if (board.has_uart0)
+ 		bcm63xx_uart_register(0);
+ 
+@@ -269,7 +273,7 @@ int __init board_register_devices(void)
+ 	while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
+ 		led_count++;
+ 
+-	if (led_count) {
++	if (led_count && !board_of_device_present("gpio0")) {
+ 		bcm63xx_led_data.num_leds = led_count;
+ 		bcm63xx_led_data.leds = board.leds;
+ 
+@@ -284,7 +288,7 @@ int __init board_register_devices(void)
+ 	while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
+ 		button_count++;
+ 
+-	if (button_count) {
++	if (button_count && !board_of_device_present("gpio0")) {
+ 		bcm63xx_gpio_keys_data.nbuttons = button_count;
+ 		bcm63xx_gpio_keys_data.buttons = board.buttons;
+ 
+--- a/arch/mips/bcm63xx/prom.c
++++ b/arch/mips/bcm63xx/prom.c
+@@ -54,9 +54,6 @@ void __init prom_init(void)
+ 	reg &= ~mask;
+ 	bcm_perf_writel(reg, PERF_CKCTL_REG);
+ 
+-	/* register gpiochip */
+-	bcm63xx_gpio_init();
+-
+ 	/* detect and setup flash access */
+ 	bcm63xx_flash_detect();
+ 
diff --git a/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch
new file mode 100644
index 0000000..f56c8ca
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch
@@ -0,0 +1,43 @@ 
+--- a/arch/mips/bcm63xx/boards/board_common.c
++++ b/arch/mips/bcm63xx/boards/board_common.c
+@@ -204,6 +204,10 @@ int __init board_register_devices(void)
+ 	}
+ #endif
+ 
++	if (!board_of_device_present("gpio0")) {
++		bcm63xx_gpio_init();
++	}
++
+ 	if (board.has_uart0)
+ 		bcm63xx_uart_register(0);
+ 
+@@ -269,7 +273,7 @@ int __init board_register_devices(void)
+ 	while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
+ 		led_count++;
+ 
+-	if (led_count) {
++	if (led_count && !board_of_device_present("gpio0")) {
+ 		bcm63xx_led_data.num_leds = led_count;
+ 		bcm63xx_led_data.leds = board.leds;
+ 
+@@ -284,7 +288,7 @@ int __init board_register_devices(void)
+ 	while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc)
+ 		button_count++;
+ 
+-	if (button_count) {
++	if (button_count && !board_of_device_present("gpio0")) {
+ 		bcm63xx_gpio_keys_data.nbuttons = button_count;
+ 		bcm63xx_gpio_keys_data.buttons = board.buttons;
+ 
+--- a/arch/mips/bcm63xx/prom.c
++++ b/arch/mips/bcm63xx/prom.c
+@@ -54,9 +54,6 @@ void __init prom_init(void)
+ 	reg &= ~mask;
+ 	bcm_perf_writel(reg, PERF_CKCTL_REG);
+ 
+-	/* register gpiochip */
+-	bcm63xx_gpio_init();
+-
+ 	/* detect and setup flash access */
+ 	bcm63xx_flash_detect();
+