[coreboot-gerrit] Patch set updated for coreboot: 29ac39a veyron: Move backlight gpio control to mainboard.c

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Tue Apr 14 21:58:41 CEST 2015


Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9630

-gerrit

commit 29ac39a01c3bc229ef4d69d20f31baf11acba5fb
Author: huang lin <hl at rock-chips.com>
Date:   Fri Dec 12 10:24:31 2014 +0800

    veyron: Move backlight gpio control to mainboard.c
    
    We use the devicetree to pass the backlight control gpio before,
    but if there have different board version, and it uses different
    io to control backlight, it will hard to distinguish it. So, we
    move the backlight control to mainboard, and use board_id
    to distinguish the backlight control.
    
    BUG=None
    TEST=emerge veyron_pinky and Boot the pinky board
    BRANCH=None
    
    Change-Id: Ifa81eb2455296f4b4285b681208f4393f266fb34
    Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
    Original-Commit-Id: 2ff7f65134dcf97f97757750eab41dcf8c7765d3
    Original-Change-Id: I1ec8e04f4982c3a8c7e31d8dc2c75311b7199ffc
    Original-Signed-off-by: huang lin <hl at rock-chips.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/234711
    Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
---
 src/mainboard/google/veyron_jerry/devicetree.cb  | 4 ----
 src/mainboard/google/veyron_jerry/mainboard.c    | 9 +++++++++
 src/mainboard/google/veyron_mighty/devicetree.cb | 4 ----
 src/mainboard/google/veyron_mighty/mainboard.c   | 9 +++++++++
 src/mainboard/google/veyron_pinky/devicetree.cb  | 4 ----
 src/mainboard/google/veyron_pinky/mainboard.c    | 9 +++++++++
 src/mainboard/google/veyron_speedy/devicetree.cb | 4 ----
 src/mainboard/google/veyron_speedy/mainboard.c   | 9 +++++++++
 src/soc/rockchip/rk3288/display.c                | 5 +----
 src/soc/rockchip/rk3288/include/soc/display.h    | 6 ++----
 10 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/src/mainboard/google/veyron_jerry/devicetree.cb b/src/mainboard/google/veyron_jerry/devicetree.cb
index be0e58c..4a2533d 100644
--- a/src/mainboard/google/veyron_jerry/devicetree.cb
+++ b/src/mainboard/google/veyron_jerry/devicetree.cb
@@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
 	device cpu_cluster 0 on end
 	register "vop_id" = "1"
 	register "framebuffer_bits_per_pixel" = "16"
-	register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
-	register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
 	register "lcd_power_on_udelay" = "200000"
-	register "bl_power_on_udelay" = "1000"
-	register "bl_pwm_to_enable_udelay" = "1000"
 end
diff --git a/src/mainboard/google/veyron_jerry/mainboard.c b/src/mainboard/google/veyron_jerry/mainboard.c
index 2aa3645..016e052 100644
--- a/src/mainboard/google/veyron_jerry/mainboard.c
+++ b/src/mainboard/google/veyron_jerry/mainboard.c
@@ -26,6 +26,7 @@
 #include <device/i2c.h>
 #include <edid.h>
 #include <gpio.h>
+#include <soc/display.h>
 #include <soc/grf.h>
 #include <soc/soc.h>
 #include <soc/pmu.h>
@@ -129,3 +130,11 @@ void lb_board(struct lb_header *header)
 	dma->range_start = (uintptr_t)_dma_coherent;
 	dma->range_size = _dma_coherent_size;
 }
+
+void mainboard_power_on_backlight(void)
+{
+	gpio_output(GPIO(7, A, 0), 0);	/* BL_EN */
+	gpio_output(GPIO(7, A, 2), 1);	/* LCD_BL */
+	mdelay(10);
+	gpio_output(GPIO(7, A, 0), 1);	/* BL_EN */
+}
diff --git a/src/mainboard/google/veyron_mighty/devicetree.cb b/src/mainboard/google/veyron_mighty/devicetree.cb
index be0e58c..4a2533d 100644
--- a/src/mainboard/google/veyron_mighty/devicetree.cb
+++ b/src/mainboard/google/veyron_mighty/devicetree.cb
@@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
 	device cpu_cluster 0 on end
 	register "vop_id" = "1"
 	register "framebuffer_bits_per_pixel" = "16"
-	register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
-	register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
 	register "lcd_power_on_udelay" = "200000"
-	register "bl_power_on_udelay" = "1000"
-	register "bl_pwm_to_enable_udelay" = "1000"
 end
diff --git a/src/mainboard/google/veyron_mighty/mainboard.c b/src/mainboard/google/veyron_mighty/mainboard.c
index 2aa3645..016e052 100644
--- a/src/mainboard/google/veyron_mighty/mainboard.c
+++ b/src/mainboard/google/veyron_mighty/mainboard.c
@@ -26,6 +26,7 @@
 #include <device/i2c.h>
 #include <edid.h>
 #include <gpio.h>
+#include <soc/display.h>
 #include <soc/grf.h>
 #include <soc/soc.h>
 #include <soc/pmu.h>
@@ -129,3 +130,11 @@ void lb_board(struct lb_header *header)
 	dma->range_start = (uintptr_t)_dma_coherent;
 	dma->range_size = _dma_coherent_size;
 }
+
+void mainboard_power_on_backlight(void)
+{
+	gpio_output(GPIO(7, A, 0), 0);	/* BL_EN */
+	gpio_output(GPIO(7, A, 2), 1);	/* LCD_BL */
+	mdelay(10);
+	gpio_output(GPIO(7, A, 0), 1);	/* BL_EN */
+}
diff --git a/src/mainboard/google/veyron_pinky/devicetree.cb b/src/mainboard/google/veyron_pinky/devicetree.cb
index be0e58c..4a2533d 100644
--- a/src/mainboard/google/veyron_pinky/devicetree.cb
+++ b/src/mainboard/google/veyron_pinky/devicetree.cb
@@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
 	device cpu_cluster 0 on end
 	register "vop_id" = "1"
 	register "framebuffer_bits_per_pixel" = "16"
-	register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
-	register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
 	register "lcd_power_on_udelay" = "200000"
-	register "bl_power_on_udelay" = "1000"
-	register "bl_pwm_to_enable_udelay" = "1000"
 end
diff --git a/src/mainboard/google/veyron_pinky/mainboard.c b/src/mainboard/google/veyron_pinky/mainboard.c
index c959726..c9d6098 100644
--- a/src/mainboard/google/veyron_pinky/mainboard.c
+++ b/src/mainboard/google/veyron_pinky/mainboard.c
@@ -26,6 +26,7 @@
 #include <device/i2c.h>
 #include <edid.h>
 #include <gpio.h>
+#include <soc/display.h>
 #include <soc/grf.h>
 #include <soc/soc.h>
 #include <soc/pmu.h>
@@ -176,3 +177,11 @@ void lb_board(struct lb_header *header)
 	dma->range_start = (uintptr_t)_dma_coherent;
 	dma->range_size = _dma_coherent_size;
 }
+
+void mainboard_power_on_backlight(void)
+{
+	gpio_output(GPIO(7, A, 0), 0);	/* BL_EN */
+	gpio_output(GPIO(7, A, 2), 1);	/* LCD_BL */
+	mdelay(10);
+	gpio_output(GPIO(7, A, 0), 1);	/* BL_EN */
+}
diff --git a/src/mainboard/google/veyron_speedy/devicetree.cb b/src/mainboard/google/veyron_speedy/devicetree.cb
index be0e58c..4a2533d 100644
--- a/src/mainboard/google/veyron_speedy/devicetree.cb
+++ b/src/mainboard/google/veyron_speedy/devicetree.cb
@@ -22,9 +22,5 @@ chip soc/rockchip/rk3288
 	device cpu_cluster 0 on end
 	register "vop_id" = "1"
 	register "framebuffer_bits_per_pixel" = "16"
-	register "lcd_bl_pwm_gpio" = "GPIO(7, A, 0)"
-	register "lcd_bl_en_gpio" = "GPIO(7, A, 2)"
 	register "lcd_power_on_udelay" = "200000"
-	register "bl_power_on_udelay" = "1000"
-	register "bl_pwm_to_enable_udelay" = "1000"
 end
diff --git a/src/mainboard/google/veyron_speedy/mainboard.c b/src/mainboard/google/veyron_speedy/mainboard.c
index 1c7dc7f..73595d7 100644
--- a/src/mainboard/google/veyron_speedy/mainboard.c
+++ b/src/mainboard/google/veyron_speedy/mainboard.c
@@ -26,6 +26,7 @@
 #include <device/i2c.h>
 #include <edid.h>
 #include <gpio.h>
+#include <soc/display.h>
 #include <soc/grf.h>
 #include <soc/soc.h>
 #include <soc/pmu.h>
@@ -128,3 +129,11 @@ void lb_board(struct lb_header *header)
 	dma->range_start = (uintptr_t)_dma_coherent;
 	dma->range_size = _dma_coherent_size;
 }
+
+void mainboard_power_on_backlight(void)
+{
+	gpio_output(GPIO(7, A, 0), 0);	/* BL_EN */
+	gpio_output(GPIO(7, A, 2), 1);	/* LCD_BL */
+	mdelay(10);
+	gpio_output(GPIO(7, A, 0), 1);	/* BL_EN */
+}
diff --git a/src/soc/rockchip/rk3288/display.c b/src/soc/rockchip/rk3288/display.c
index a8ba31a..68b4b8f 100644
--- a/src/soc/rockchip/rk3288/display.c
+++ b/src/soc/rockchip/rk3288/display.c
@@ -82,8 +82,5 @@ void rk_display_init(device_t dev, u32 lcdbase,
 	}
 
 	set_vbe_mode_info_valid(&edid, (uintptr_t)lcdbase);
-	gpio_output(conf->lcd_bl_pwm_gpio, 0);
-	gpio_output(conf->lcd_bl_en_gpio, 1); /* LCD_BL */
-	udelay(conf->bl_power_on_udelay);
-	gpio_output(conf->lcd_bl_pwm_gpio, 1); /* BL_EN */
+	mainboard_power_on_backlight();
 }
diff --git a/src/soc/rockchip/rk3288/include/soc/display.h b/src/soc/rockchip/rk3288/include/soc/display.h
index 8353c8a..b0b5e64 100644
--- a/src/soc/rockchip/rk3288/include/soc/display.h
+++ b/src/soc/rockchip/rk3288/include/soc/display.h
@@ -23,8 +23,6 @@
 void rk_display_init(device_t dev, u32 lcdbase,
 		unsigned long fb_size);
 
-#endif
-
-
-
+void mainboard_power_on_backlight(void);
 
+#endif



More information about the coreboot-gerrit mailing list