board: ge: complete DM conversion
Subsystems (3)
cover board: ge: complete DM conversion
This series finishes the conversion to DM mode for drivers used on GE boards.
The first patch adds the ability to specify partitions for eeprom in the device tree, and query eeprom device sizes.
Each partition creates a child device, allowing board code to find the eeprom parition by name.
This feature is used in the second and third patches.
The bulk of the work is for converting i2c board code to DM driver accesses for the various drivers.
Ian Ray (4):
board: ge: mx53ppd: enable DM_VIDEO
board: ge: bx50v3: override panel
board: ge: mx53ppd: use DM for uart
board: ge: bx50v3, imx53ppd: configure CONFIG_SYS_BOOTMAPSZ
Robert Beckett (9):
misc: i2c_eeprom: set offset len and chip addr offset mask
board: ge: bx50v3, imx53ppd: add eeprom partitions
board: ge: bx50v3, imx53ppd: use DM I2C
board: ge: bx50v3: add i2c eeprom bootcount storage
board: ge: mx53ppd: add i2c eeprom bootcount storage
board: ge: bx50v3: Enable DM PWM for backlight
board: ge: mx53ppd: Use DM for ethernet
board: ge: bx50v3: use DM for uart
board: ge: bx50v3, mx53ppd: fix firstboot detection
arch/arm/dts/imx53-ppd-uboot.dtsi | 46 ++++++++ arch/arm/dts/imx53-ppd.dts | 5 +- arch/arm/dts/imx6q-b450v3.dts | 2 + arch/arm/dts/imx6q-b650v3.dts | 2 + arch/arm/dts/imx6q-b850v3.dts | 2 + arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 25 ++++ arch/arm/dts/imx6q-bx50v3.dtsi | 3 +- board/ge/bx50v3/Kconfig | 2 - board/ge/bx50v3/bx50v3.c | 219 ++++++----------------------------- board/ge/common/Kconfig | 14 --- board/ge/common/ge_common.c | 17 +-- board/ge/common/vpd_reader.c | 37 +++--- board/ge/mx53ppd/Kconfig | 2 - board/ge/mx53ppd/Makefile | 2 +- board/ge/mx53ppd/mx53ppd.c | 67 +---------- board/ge/mx53ppd/mx53ppd_video.c | 125 +++++++------------- board/ge/mx53ppd/ppd_gpio.h | 8 -- configs/ge_bx50v3_defconfig | 27 ++++- configs/mx53ppd_defconfig | 31 +++-- drivers/misc/i2c_eeprom.c | 35 ++++++ include/configs/ge_bx50v3.h | 49 ++------ include/configs/mx53ppd.h | 76 ++---------- 22 files changed, 295 insertions(+), 501 deletions(-) delete mode 100644 board/ge/common/Kconfig
Signature · 1 line
2.10.1
PATCH 1/13 misc: i2c_eeprom: set offset len and chip addr offset mask
From: Robert Beckett <[email protected]>
Set the correct offset length and chip address offset mask for each device to allow correct access to total capacity of the devices.
--- drivers/misc/i2c_eeprom.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/misc/i2c_eeprom.c +35 -0
@@ -15,6 +15,8 @@struct i2c_eeprom_drv_data {u32 size;/* size in bytes */ u32 pagewidth;/* pagesize = 2^pagewidth */ +u32 addr_offset_mask;/* bits in addr used for offset overflow */ +u32 offset_len;/* size in bytes of offset */ };int i2c_eeprom_read (struct udevice *dev,int offset,uint8_t *buf,int size)
@@ -140,6 +142,11 @@ static int i2c_eeprom_std_probe(struct udevice *dev) {u8 test_byte;int ret; +struct i2c_eeprom_drv_data *data = + (struct i2c_eeprom_drv_data *)dev_get_driver_data (dev); + +i2c_set_chip_offset_len (dev, data->offset_len); +i2c_set_chip_addr_offset_mask (dev, data->addr_offset_mask);/* Verify that the chip is functional */ ret =i2c_eeprom_read (dev,0 , &test_byte,1 );
@@ -152,71 +159,99 @@ static int i2c_eeprom_std_probe(struct udevice *dev)static const struct i2c_eeprom_drv_data eeprom_data = { .size =0 , .pagewidth =0 , + .addr_offset_mask =0 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data mc24aa02e48_data = { .size =256 , .pagewidth =3 , + .addr_offset_mask =0 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c01a_data = { .size =128 , .pagewidth =3 , + .addr_offset_mask =0 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c02_data = { .size =256 , .pagewidth =3 , + .addr_offset_mask =0 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c04_data = { .size =512 , .pagewidth =4 , + .addr_offset_mask =0x1 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c08_data = { .size =1024 , .pagewidth =4 , + .addr_offset_mask =0x3 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c08a_data = { .size =1024 , .pagewidth =4 , + .addr_offset_mask =0x3 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c16a_data = { .size =2048 , .pagewidth =4 , + .addr_offset_mask =0x7 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24mac402_data = { .size =256 , .pagewidth =4 , + .addr_offset_mask =0 , + .offset_len =1 , };static const struct i2c_eeprom_drv_data atmel24c32_data = { .size =4096 , .pagewidth =5 , + .addr_offset_mask =0 , + .offset_len =2 , };static const struct i2c_eeprom_drv_data atmel24c64_data = { .size =8192 , .pagewidth =5 , + .addr_offset_mask =0 , + .offset_len =2 , };static const struct i2c_eeprom_drv_data atmel24c128_data = { .size =16384 , .pagewidth =6 , + .addr_offset_mask =0 , + .offset_len =2 , };static const struct i2c_eeprom_drv_data atmel24c256_data = { .size =32768 , .pagewidth =6 , + .addr_offset_mask =0 , + .offset_len =2 , };static const struct i2c_eeprom_drv_data atmel24c512_data = { .size =65536 , .pagewidth =6 , + .addr_offset_mask =0 , + .offset_len =2 , };static const struct udevice_id i2c_eeprom_std_ids[] = {
Signature · 1 line
2.10.1
PATCH 1/13 misc: i2c_eeprom: set offset len and chip addr offset mask
Quoted 4 lines
From: Robert Beckett <[email protected]>
Set the correct offset length and chip address offset mask for each device to allow correct access to total capacity of the devices.Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 2/13 board: ge: bx50v3, imx53ppd: add eeprom partitions
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Add eeprom partitions to device tree.
--- arch/arm/dts/imx53-ppd-uboot.dtsi | 16 ++++++++++++++++ arch/arm/dts/imx53-ppd.dts | 3 ++- arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 16 ++++++++++++++++ arch/arm/dts/imx6q-bx50v3.dtsi | 3 ++- 4 files changed, 36 insertions(+), 2 deletions(-)
arch/arm/dts/imx53-ppd-uboot.dtsi +16 -0
@@ -10,3 +10,19 @@ wdt = <&wdog1>; }; }; + +&eeprom { + partitions { + compatible = "fixed-partitions"; + + vpd { + offset = <0>; + size = <1022>; + }; + + bootcount { + offset = <1022>; + size = <2>; + }; + }; +};
arch/arm/dts/imx53-ppd.dts +2 -1
@@ -43,7 +43,6 @@ /dts-v1/; #include "imx53.dtsi" -#include "imx53-ppd-uboot.dtsi" #include <dt-bindings/input/input.h> / {
@@ -1084,3 +1083,5 @@ >; }; }; + +#include "imx53-ppd-uboot.dtsi"
arch/arm/dts/imx6q-bx50v3-uboot.dtsi +16 -0
@@ -10,3 +10,19 @@ wdt = <&wdog1>; }; }; + +&eeprom { + partitions { + compatible = "fixed-partitions"; + + vpd { + offset = <0>; + size = <1022>; + }; + + bootcount { + offset = <1022>; + size = <2>; + }; + }; +};
arch/arm/dts/imx6q-bx50v3.dtsi +2 -1
@@ -42,7 +42,6 @@ */ #include "imx6q-ba16.dtsi" -#include "imx6q-bx50v3-uboot.dtsi" / { mclk: clock-mclk {
@@ -379,3 +378,5 @@ #interrupt-cells = <1>; }; }; + +#include "imx6q-bx50v3-uboot.dtsi"
Signature · 1 line
2.10.1
PATCH 2/13 board: ge: bx50v3, imx53ppd: add eeprom partitions
Quoted 3 lines
From: Robert Beckett <[email protected]>
Add eeprom partitions to device tree.Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 3/13 board: ge: bx50v3, imx53ppd: use DM I2C
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Remove old (pre-DM) i2c setup code.
Enable DM i2c.
Convert common code to use DM rtc.
Convert common code to read VPD from eeprom partition. Convert the generic i2c PMIC init code to use the new da9063 driver.
mx53ppd only:
Correct RTC compatible in device tree.
Enable MXC DM i2c driver.
Define CONFIG_SYS_MALLOC_F_LEN so that DM is available in pre-reloc. Make GPIO banks available during preloc, since initialisation is done in board_early_init_f().
Add gpio_request() calls to satisfy the DM_GPIO compatibility API. Remove unused power configuration.
---
Note: this is a squash of a few commits due to dropping of i2c compat api
--- arch/arm/dts/imx53-ppd-uboot.dtsi | 20 +++++++ arch/arm/dts/imx53-ppd.dts | 2 +- board/ge/bx50v3/Kconfig | 2 - board/ge/bx50v3/bx50v3.c | 114 ++++++++------------------------------ board/ge/common/Kconfig | 14 ----- board/ge/common/ge_common.c | 17 ++---- board/ge/common/vpd_reader.c | 37 ++++++++----- board/ge/mx53ppd/Kconfig | 2 - board/ge/mx53ppd/mx53ppd.c | 35 +----------- board/ge/mx53ppd/mx53ppd_video.c | 1 + configs/ge_bx50v3_defconfig | 15 ++++- configs/mx53ppd_defconfig | 12 +++- include/configs/ge_bx50v3.h | 27 --------- include/configs/mx53ppd.h | 35 ------------ 14 files changed, 97 insertions(+), 236 deletions(-) delete mode 100644 board/ge/common/Kconfig
arch/arm/dts/imx53-ppd-uboot.dtsi +20 -0
@@ -26,3 +26,23 @@ }; }; }; + +&gpio1 { + u-boot,dm-pre-reloc; +}; + +&gpio2 { + u-boot,dm-pre-reloc; +}; + +&gpio3 { + u-boot,dm-pre-reloc; +}; + +&gpio4 { + u-boot,dm-pre-reloc; +}; + +&gpio5 { + u-boot,dm-pre-reloc; +};
arch/arm/dts/imx53-ppd.dts +1 -1
@@ -489,7 +489,7 @@ reg = <1>; rtc at 30 { - compatible = "sii,s35390a"; + compatible = "sii,s35392a-rtc"; reg = <0x30>; };
board/ge/bx50v3/Kconfig +0 -2
@@ -15,6 +15,4 @@ config SYS_SOC config SYS_CONFIG_NAME default "ge_bx50v3" -source "board/ge/common/Kconfig" - endif
board/ge/bx50v3/bx50v3.c +22 -92
144 lines not on this page · raw message
board/ge/common/Kconfig deleted +0 -14
@@ -1,14 +0,0 @@ -config SYS_VPD_EEPROM_I2C_ADDR - hex "I2C address of the EEPROM device used for VPD" - help - VPD = Vital Product Data - -config SYS_VPD_EEPROM_I2C_BUS - int "I2C bus of the EEPROM device used for VPD." - -config SYS_VPD_EEPROM_SIZE - int "Size in bytes of the EEPROM device used for VPD" - -config SYS_VPD_EEPROM_I2C_ADDR_LEN - int "Number of bytes to use for VPD EEPROM address" - default 1
board/ge/common/ge_common.c +6 -11
@@ -5,27 +5,24 @@#include <common.h> #include <env.h> -#include <i2c.h> +#include <dm/uclass.h> #include <rtc.h> void check_time (void ) { +struct udevice *dev;int ret, i;struct rtc_time tm;u8 retry =3 ; -unsigned int current_i2c_bus =i2c_get_bus_num (); - - ret =i2c_set_bus_num (CONFIG_SYS_RTC_BUS_NUM ); -if (ret <0 ) { + ret =uclass_get_device (UCLASS_RTC ,0 , &dev); +if (ret) {env_set ("rtc_status" ,"FAIL" );return ; } -rtc_init (); -for (i =0 ; i < retry; i++) { - ret =rtc_get (&tm); + ret =dm_rtc_get (dev, &tm);if (!ret || ret == -EINVAL )break ; }
@@ -40,7 +37,7 @@ void check_time(void) tm.tm_year =2036 ;for (i =0 ; i < retry; i++) { - ret =rtc_set (&tm); + ret =dm_rtc_set (dev, &tm);if (!ret)break ; }
@@ -55,7 +52,5 @@ void check_time(void)env_set ("rtc_status" ,"2038" ); else env_set("rtc_status", "OK"); - -i2c_set_bus_num (current_i2c_bus); }
board/ge/common/vpd_reader.c +23 -14
@@ -8,6 +8,9 @@#include <i2c.h> #include <linux/bch.h> #include <stdlib.h> +#include <dm/uclass.h> +#include <i2c_eeprom.h> +#include <hexdump.h> /* BCH configuration */
@@ -200,28 +203,34 @@ int read_vpd(struct vpd_cache *cache,int (*process_block)(struct vpd_cache *,u8 id,u8 version, u8 type, size_t size, u8 const *data)) { -static const size_t size =CONFIG_SYS_VPD_EEPROM_SIZE ; - -int res; +struct udevice *dev; +int ret;u8 *data; -unsigned int current_i2c_bus =i2c_get_bus_num (); +int size; + + ret =uclass_get_device_by_name (UCLASS_I2C_EEPROM ,"vpd" , &dev); +if (ret) +return ret; - res =i2c_set_bus_num (CONFIG_SYS_VPD_EEPROM_I2C_BUS ); -if (res <0 ) -return res; + size =i2c_eeprom_size (dev); +if (size <0 ) { +printf ("Unable to get size of eeprom: %d\n" , ret); +return ret; + } data =malloc (size);if (!data)return -ENOMEM ; - res =i2c_read (CONFIG_SYS_VPD_EEPROM_I2C_ADDR ,0 , -CONFIG_SYS_VPD_EEPROM_I2C_ADDR_LEN , - data, size); -if (res ==0 ) - res =vpd_reader (size, data, cache, process_block); + ret =i2c_eeprom_read (dev,0 , data, size); +if (ret) { +free (data); +return ret; + } + + ret =vpd_reader (size, data, cache, process_block);free (data); -i2c_set_bus_num (current_i2c_bus); -return res; +return ret; }
board/ge/mx53ppd/Kconfig +0 -2
@@ -13,6 +13,4 @@ config SYS_SOC config SYS_CONFIG_NAME default "mx53ppd" -source "board/ge/common/Kconfig" - endif
board/ge/mx53ppd/mx53ppd.c +3 -32
@@ -125,34 +125,6 @@ static void setup_iomux_fec(void)imx_iomux_v3_setup_multiple_pads (fec_pads,ARRAY_SIZE (fec_pads)); } -#define I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ - PAD_CTL_PUS_100K_UP | PAD_CTL_ODE) - -static void setup_iomux_i2c (void ) -{ -static const iomux_v3_cfg_t i2c1_pads[] = { -NEW_PAD_CTRL (MX53_PAD_CSI0_DAT8__I2C1_SDA ,I2C_PAD_CTRL ), -NEW_PAD_CTRL (MX53_PAD_CSI0_DAT9__I2C1_SCL ,I2C_PAD_CTRL ), - }; - -imx_iomux_v3_setup_multiple_pads (i2c1_pads,ARRAY_SIZE (i2c1_pads)); -} - -#define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL) - -static struct i2c_pads_info i2c_pad_info1 = { - .scl = { - .i2c_mode =MX53_PAD_EIM_D21__I2C1_SCL |I2C_PAD , - .gpio_mode =MX53_PAD_EIM_D28__GPIO3_28 |I2C_PAD , - .gp =IMX_GPIO_NR (3 ,28 ) - }, - .sda = { - .i2c_mode =MX53_PAD_EIM_D28__I2C1_SDA |I2C_PAD , - .gpio_mode =MX53_PAD_EIM_D21__GPIO3_21 |I2C_PAD , - .gp =IMX_GPIO_NR (3 ,21 ) - } -}; -static int clock_1GHz (void ) {int ret;
@@ -182,8 +154,10 @@ void ppd_gpio_init(void)int i;imx_iomux_v3_setup_multiple_pads (ppd_pads,ARRAY_SIZE (ppd_pads)); -for (i =0 ; i <ARRAY_SIZE (ppd_gpios); ++i) +for (i =0 ; i <ARRAY_SIZE (ppd_gpios); ++i) { +gpio_request (ppd_gpios[i].gpio,"request" );gpio_direction_output (ppd_gpios[i].gpio, ppd_gpios[i].value); + } }int board_early_init_f (void )
@@ -256,9 +230,6 @@ int board_init(void) gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;mxc_set_sata_internal_clock (); -setup_iomux_i2c (); - -setup_i2c (1 ,CONFIG_SYS_I2C_SPEED ,0x7f , &i2c_pad_info1);return 0 ; }
board/ge/mx53ppd/mx53ppd_video.c +1 -0
@@ -104,6 +104,7 @@ static void lcd_enable(void)pwm_config (1 ,5000000 ,5000000 );/* Backlight Power */ +gpio_request (BACKLIGHT_ENABLE ,"BACKLIGHT_ENABLE" );gpio_direction_output (BACKLIGHT_ENABLE ,1 );pwm_enable (1 );
configs/ge_bx50v3_defconfig +12 -3
@@ -2,9 +2,6 @@ CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 CONFIG_SYS_MALLOC_F_LEN=0x4000 -CONFIG_SYS_VPD_EEPROM_I2C_ADDR=0x50 -CONFIG_SYS_VPD_EEPROM_I2C_BUS=4 -CONFIG_SYS_VPD_EEPROM_SIZE=1024 CONFIG_TARGET_GE_BX50V3=y CONFIG_ENV_SIZE=0x2000 CONFIG_ENV_SECT_SIZE=0x10000
@@ -51,6 +48,12 @@ CONFIG_BOOTCOUNT_EXT=y CONFIG_BOOTCOUNT_BOOTLIMIT=10 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5" CONFIG_DM_MMC=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MXC=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_FSL_USDHC=y CONFIG_MTD=y
@@ -71,6 +74,12 @@ CONFIG_DM_PCI=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y CONFIG_PWM_IMX=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_DA9063=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_DA9063=y +CONFIG_DM_RTC=y +CONFIG_RTC_RX8010SJ=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MXC_SPI=y
configs/mx53ppd_defconfig +9 -3
@@ -2,9 +2,6 @@ CONFIG_ARM=y CONFIG_ARCH_MX5=y CONFIG_SYS_TEXT_BASE=0x77800000 CONFIG_TARGET_MX53PPD=y -CONFIG_SYS_VPD_EEPROM_I2C_ADDR=0x50 -CONFIG_SYS_VPD_EEPROM_I2C_BUS=2 -CONFIG_SYS_VPD_EEPROM_SIZE=1024 CONFIG_ENV_SIZE=0x2800 CONFIG_ENV_OFFSET=0xC0000 CONFIG_NR_DRAM_BANKS=2
@@ -41,6 +38,13 @@ CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_EXT=y CONFIG_BOOTCOUNT_BOOTLIMIT=10 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5" +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MXC=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_DM_MMC=y CONFIG_FSL_ESDHC_IMX=y CONFIG_MTD=y
@@ -49,6 +53,7 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX5=y CONFIG_DM_REGULATOR=y CONFIG_PWM_IMX=y +CONFIG_DM_RTC=y CONFIG_RTC_S35392A=y CONFIG_SYSRESET=y CONFIG_SYSRESET_WATCHDOG=y
@@ -60,3 +65,4 @@ CONFIG_VIDEO=y # CONFIG_VIDEO_SW_CURSOR is not set CONFIG_WATCHDOG_TIMEOUT_MSECS=8000 CONFIG_IMX_WATCHDOG=y +CONFIG_SYS_MALLOC_F_LEN=0x4000
include/configs/ge_bx50v3.h +0 -27
@@ -189,33 +189,6 @@#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(1, 5) -#define CONFIG_RTC_RX8010SJ -#define CONFIG_SYS_RTC_BUS_NUM 2 -#define CONFIG_SYS_I2C_RTC_ADDR 0x32 - -/* I2C Configs */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_SPEED 100000 -#define CONFIG_SYS_I2C_MXC_I2C1 -#define CONFIG_SYS_I2C_MXC_I2C2 -#define CONFIG_SYS_I2C_MXC_I2C3 - -#define CONFIG_SYS_NUM_I2C_BUSES 11 -#define CONFIG_SYS_I2C_MAX_HOPS 1 -#define CONFIG_SYS_I2C_BUSES { {0, {I2C_NULL_HOP} }, \ - {1, {I2C_NULL_HOP} }, \ - {2, {I2C_NULL_HOP} }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 0} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 3} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 4} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 5} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 6} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 7} } }, \ - } -#define CONFIG_BCH #endif /* __GE_BX50V3_CONFIG_H */
include/configs/mx53ppd.h +0 -35
@@ -43,25 +43,6 @@#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)#define CONFIG_MXC_USB_FLAGS 0 -#define CONFIG_SYS_RTC_BUS_NUM 2 -#define CONFIG_SYS_I2C_RTC_ADDR 0x30 - -/* I2C Configs */ -#define CONFIG_SYS_I2C -#define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ - -/* PMIC Controller */ -#define CONFIG_POWER -#define CONFIG_POWER_I2C -#define CONFIG_DIALOG_POWER -#define CONFIG_POWER_FSL -#define CONFIG_POWER_FSL_MC13892 -#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48 -#define CONFIG_SYS_FSL_PMIC_I2C_ADDR 0x8 -/* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_BAUDRATE 115200
@@ -188,22 +169,6 @@#define CONFIG_CMD_FUSE #define CONFIG_FSL_IIM -#define CONFIG_SYS_I2C_SPEED 100000 - -/* I2C1 */ -#define CONFIG_SYS_NUM_I2C_BUSES 9 -#define CONFIG_SYS_I2C_MAX_HOPS 1 -#define CONFIG_SYS_I2C_BUSES { {0, {I2C_NULL_HOP} }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 0} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 3} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 4} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 5} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 6} } }, \ - {0, {{I2C_MUX_PCA9547, 0x70, 7} } }, \ - } -#define CONFIG_BCH /* Backlight Control */
Signature · 1 line
2.10.1
PATCH 3/13 board: ge: bx50v3, imx53ppd: use DM I2C
Quoted 14 lines
From: Robert Beckett <[email protected]>
Remove old (pre-DM) i2c setup code.
Enable DM i2c.
Convert common code to use DM rtc.
Convert common code to read VPD from eeprom partition. Convert the generic i2c PMIC init code to use the new da9063 driver. mx53ppd only:
Correct RTC compatible in device tree.
Enable MXC DM i2c driver.
DefineCONFIG_SYS_MALLOC_F_LENso that DM is available in pre-reloc. Make GPIO banks available during preloc, since initialisation is done inboard_early_init_f().
Addgpio_request()calls to satisfy theDM_GPIOcompatibility API. Remove unused power configuration.
Quoted 2 lines
Signed-off-by Robert Beckett <[email protected]>Signed-off-by Ian Ray <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 4/13 board: ge: bx50v3: add i2c eeprom bootcount storage
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.
--- arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 7 ++++++- configs/ge_bx50v3_defconfig | 6 +++--- include/configs/ge_bx50v3.h | 4 +--- 3 files changed, 10 insertions(+), 7 deletions(-)
arch/arm/dts/imx6q-bx50v3-uboot.dtsi +6 -1
@@ -5,6 +5,11 @@ */ / { + bootcount { + compatible = "u-boot,bootcount-i2c-eeprom"; + i2c-eeprom = <&bootcount>; + }; + wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>;
@@ -20,7 +25,7 @@ size = <1022>; }; - bootcount { + bootcount: bootcount { offset = <1022>; size = <2>; };
configs/ge_bx50v3_defconfig +3 -3
@@ -8,7 +8,6 @@ CONFIG_ENV_SECT_SIZE=0x10000 CONFIG_ENV_OFFSET=0xC0000 CONFIG_DM_GPIO=y CONFIG_NR_DRAM_BANKS=1 -CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_FIT=y CONFIG_OF_BOARD_SETUP=y
@@ -29,6 +28,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y # CONFIG_CMD_NFS is not set +CONFIG_CMD_BOOTCOUNT=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y
@@ -44,9 +44,9 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_BOOTCOUNT_LIMIT=y -CONFIG_BOOTCOUNT_EXT=y +CONFIG_DM_BOOTCOUNT=y +CONFIG_DM_BOOTCOUNT_I2C_EEPROM=y CONFIG_BOOTCOUNT_BOOTLIMIT=10 -CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5" CONFIG_DM_MMC=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y
include/configs/ge_bx50v3.h +1 -3
@@ -109,9 +109,7 @@"setcurs 5 4; " \"lcdputs \"Monitor failed to start. " \"Try again, or contact GE Service for support.\"; " \ -"mw.b 0x7000A000 0xbc; " \ -"mw.b 0x7000A001 0x00; " \ -"ext4write ${dev} ${devnum}:5 0x7000A000 /boot/failures 2\0" \ +"bootcount reset; \0" \"altbootcmd=" \"run doquiet; " \"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
Signature · 1 line
2.10.1
PATCH 4/13 board: ge: bx50v3: add i2c eeprom bootcount storage
Quoted 6 lines
From: Robert Beckett <[email protected]>
Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 5/13 board: ge: mx53ppd: add i2c eeprom bootcount storage
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.
--- arch/arm/dts/imx53-ppd-uboot.dtsi | 7 ++++++- configs/mx53ppd_defconfig | 6 +++--- include/configs/mx53ppd.h | 4 +--- 3 files changed, 10 insertions(+), 7 deletions(-)
arch/arm/dts/imx53-ppd-uboot.dtsi +6 -1
@@ -9,6 +9,11 @@ compatible = "wdt-reboot"; wdt = <&wdog1>; }; + + bootcount { + compatible = "u-boot,bootcount-i2c-eeprom"; + i2c-eeprom = <&bootcount>; + }; }; &eeprom {
@@ -20,7 +25,7 @@ size = <1022>; }; - bootcount { + bootcount: bootcount { offset = <1022>; size = <2>; };
configs/mx53ppd_defconfig +3 -3
@@ -5,7 +5,6 @@ CONFIG_TARGET_MX53PPD=y CONFIG_ENV_SIZE=0x2800 CONFIG_ENV_OFFSET=0xC0000 CONFIG_NR_DRAM_BANKS=2 -CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000 CONFIG_FIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/ge/mx53ppd/imximage.cfg"
@@ -22,6 +21,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y +CONFIG_CMD_BOOTCOUNT=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_EXT2=y
@@ -35,9 +35,9 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_BOOTCOUNT_LIMIT=y -CONFIG_BOOTCOUNT_EXT=y +CONFIG_DM_BOOTCOUNT=y +CONFIG_DM_BOOTCOUNT_I2C_EEPROM=y CONFIG_BOOTCOUNT_BOOTLIMIT=10 -CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5" CONFIG_DM_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y
include/configs/mx53ppd.h +1 -3
@@ -98,9 +98,7 @@"setenv stdout vga; " \"echo \"\n\n\n\n \" $msg; " \"setenv stdout serial; " \ -"mw.b 0x7000A000 0xbc; " \ -"mw.b 0x7000A001 0x00; " \ -"ext4write ${dev} ${devnum}:5 0x7000A000 /boot/failures 2\0" \ +"bootcount reset; \0" \"altbootcmd=" \"run doquiet; " \"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
Signature · 1 line
2.10.1
PATCH 5/13 board: ge: mx53ppd: add i2c eeprom bootcount storage
Quoted 6 lines
From: Robert Beckett <[email protected]>
Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 6/13 board: ge: mx53ppd: enable DM_VIDEO
In reply to Ian RayEnable DM_VIDEO for mx53ppd.
Enable DM_REGULATOR_FIXED and DM_PWM for the backlight. Remove unused MX53PPD_LCD_POWER.
Remove old (incorrect) setup_iomux_lcd.
Enable backlight via display enable handler.
Use cls command to initiate display in HW agnostic manner. Modify `failbootcmd' to use lcdputs.
--- arch/arm/dts/imx53-ppd-uboot.dtsi | 5 ++ board/ge/mx53ppd/Makefile | 2 +- board/ge/mx53ppd/mx53ppd.c | 3 - board/ge/mx53ppd/mx53ppd_video.c | 126 +++++++++++++------------------------- board/ge/mx53ppd/ppd_gpio.h | 2 - configs/mx53ppd_defconfig | 7 ++- include/configs/mx53ppd.h | 13 ++-- 7 files changed, 61 insertions(+), 97 deletions(-)
arch/arm/dts/imx53-ppd-uboot.dtsi +5 -0
@@ -14,6 +14,11 @@ compatible = "u-boot,bootcount-i2c-eeprom"; i2c-eeprom = <&bootcount>; }; + + panel-lvds0 { + compatible = "simple-panel"; + backlight = <&pwm_bl>; + }; }; &eeprom {
board/ge/mx53ppd/Makefile +1 -1
@@ -7,4 +7,4 @@ # Jason Liu <[email protected]> obj-y += mx53ppd.o -obj-$(CONFIG_VIDEO) += mx53ppd_video.o +obj-$(CONFIG_DM_VIDEO) += mx53ppd_video.o
board/ge/mx53ppd/mx53ppd.c +0 -3
@@ -39,8 +39,6 @@#include "../../ge/common/ge_common.h" #include "../../ge/common/vpd_reader.h" -#define MX53PPD_LCD_POWER IMX_GPIO_NR(3, 24) -DECLARE_GLOBAL_DATA_PTR ;static u32 mx53_dram_size[2 ];
@@ -163,7 +161,6 @@ void ppd_gpio_init(void)int board_early_init_f (void ) {setup_iomux_fec (); -setup_iomux_lcd ();ppd_gpio_init ();return 0 ;
board/ge/mx53ppd/mx53ppd_video.c +43 -83
152 lines not on this page · raw message
board/ge/mx53ppd/ppd_gpio.h +0 -2
@@ -57,7 +57,6 @@ struct gpio_cfg {#define POWER_DOWN_LVDS0_DESERIALIZER_N IMX_GPIO_NR(2, 22)#define POWER_DOWN_LVDS1_DESERIALIZER_N IMX_GPIO_NR(2, 27)#define ENABLE_PWR_TO_LCD_AND_UI_INTERFACE IMX_GPIO_NR(2, 17) -#define BACKLIGHT_ENABLE IMX_GPIO_NR(5, 29)#define RESET_I2C1_BUS_SEGMENT_MUX_N IMX_GPIO_NR(2, 18)#define ECSPI1_CS0 IMX_GPIO_NR(5, 17)#define ECSPI1_CS1 IMX_GPIO_NR(4, 10)
@@ -87,7 +86,6 @@ static const struct gpio_cfg ppd_gpios[] = { { POWER_DOWN_LVDS0_DESERIALIZER_N, 1 }, { POWER_DOWN_LVDS1_DESERIALIZER_N, 1 }, { ENABLE_PWR_TO_LCD_AND_UI_INTERFACE, 1 }, - { BACKLIGHT_ENABLE, 0 }, { RESET_I2C1_BUS_SEGMENT_MUX_N, 1 }, { ECSPI1_CS0, 1 }, { ECSPI1_CS1, 1 },
configs/mx53ppd_defconfig +6 -1
@@ -24,6 +24,7 @@ CONFIG_CMD_DHCP=y CONFIG_CMD_BOOTCOUNT=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_CLS=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y
@@ -52,6 +53,7 @@ CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX5=y CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y CONFIG_PWM_IMX=y CONFIG_DM_RTC=y CONFIG_RTC_S35392A=y
@@ -61,8 +63,11 @@ CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_EHCI_MX5=y CONFIG_VIDEO_IPUV3=y -CONFIG_VIDEO=y # CONFIG_VIDEO_SW_CURSOR is not set CONFIG_WATCHDOG_TIMEOUT_MSECS=8000 CONFIG_IMX_WATCHDOG=y CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_DM_PWM=y +CONFIG_VIDEO_BPP16=y
include/configs/mx53ppd.h +6 -7
@@ -91,13 +91,10 @@"/boot/bootcause/firstboot\0" \"swappartitions=setexpr partnum 3 - ${partnum}\0" \"failbootcmd=" \ -"ppd_lcd_enable; " \ -"msg=\"Monitor failed to start. " \ -"Try again, or contact GE Service for support.\"; " \ -"echo $msg; " \ -"setenv stdout vga; " \ -"echo \"\n\n\n\n \" $msg; " \ -"setenv stdout serial; " \ +"cls; " \ +"setcurs 5 4; " \ +"lcdputs \"Monitor failed to start. " \ +"Try again, or contact GE Service for support.\"; " \"bootcount reset; \0" \"altbootcmd=" \"run doquiet; " \
@@ -172,4 +169,6 @@/* Backlight Control */ #define CONFIG_IMX6_PWM_PER_CLK 66666000 +#define CONFIG_IMX_VIDEO_SKIP +#endif /* __CONFIG_H */
Signature · 1 line
2.10.1
PATCH 6/13 board: ge: mx53ppd: enable DM_VIDEO
Quoted 9 lines
Enable
DM_VIDEOfor mx53ppd.
EnableDM_REGULATOR_FIXEDandDM_PWMfor the backlight. Remove unusedMX53PPD_LCD_POWER.
Remove old (incorrect)setup_iomux_lcd.
Enable backlight via display enable handler.
Use cls command to initiate display in HW agnostic manner. Modify `failbootcmd' to use lcdputs.Signed-off-by Ian Ray <[email protected]>Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 7/13 board: ge: bx50v3: override panel
In reply to Ian RayOverride the panel compatible string for LCD in U-Boot.
Include U-Boot device tree overrides in device-specific device trees so that the panel compatible string is used.
--- arch/arm/dts/imx6q-b450v3.dts | 2 ++ arch/arm/dts/imx6q-b650v3.dts | 2 ++ arch/arm/dts/imx6q-b850v3.dts | 2 ++ arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 4 ++++ 4 files changed, 10 insertions(+)
arch/arm/dts/imx6q-b450v3.dts +2 -0
@@ -158,3 +158,5 @@ }; }; }; + +#include "imx6q-bx50v3-uboot.dtsi"
arch/arm/dts/imx6q-b650v3.dts +2 -0
@@ -157,3 +157,5 @@ }; }; }; + +#include "imx6q-bx50v3-uboot.dtsi"
arch/arm/dts/imx6q-b850v3.dts +2 -0
@@ -300,3 +300,5 @@ phy-handle = <&switchphy4>; }; }; + +#include "imx6q-bx50v3-uboot.dtsi"
arch/arm/dts/imx6q-bx50v3-uboot.dtsi +4 -0
@@ -14,6 +14,10 @@ compatible = "wdt-reboot"; wdt = <&wdog1>; }; + + panel-lvds0 { + compatible = "simple-panel"; + }; }; &eeprom {
Signature · 1 line
2.10.1
PATCH 7/13 board: ge: bx50v3: override panel
Quoted 5 lines
Override the panel compatible string for LCD in U-Boot. Include U-Boot device tree overrides in device-specific device trees so that the panel compatible string is used.
Fixes 8c26739859c6 ("board: ge: bx50v3: sync devicetrees from Linux")Signed-off-by Ian Ray <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 8/13 board: ge: bx50v3: Enable DM PWM for backlight
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Add backlight and panel devicetree definitions
Use UCLASS_PANEL to enable backlight via display enable handler Remove old explicit gpio code for handling backlight Use cls command to initiate display in HW agnostic manner Enable DM regulator and pwm
--- board/ge/bx50v3/bx50v3.c | 81 +++++++++------------------------------------ configs/ge_bx50v3_defconfig | 3 ++ include/configs/ge_bx50v3.h | 2 +- 3 files changed, 20 insertions(+), 66 deletions(-)
board/ge/bx50v3/bx50v3.c +16 -65
@@ -37,6 +37,7 @@#include "../common/vpd_reader.h" #include "../../../drivers/net/e1000.h" #include <pci.h> +#include <panel.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -124,16 +125,20 @@ int board_phy_config(struct phy_device *phydev) }#if defined(CONFIG_VIDEO_IPUV3 ) -static iomux_v3_cfg_t const backlight_pads[] = { -/* Power for LVDS Display */ -MX6_PAD_EIM_D22__GPIO3_IO22 |MUX_PAD_CTRL (NO_PAD_CTRL ), -#define LVDS_POWER_GP IMX_GPIO_NR(3, 22) -/* Backlight enable for LVDS display */ -MX6_PAD_GPIO_0__GPIO1_IO00 |MUX_PAD_CTRL (NO_PAD_CTRL ), -#define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) -/* backlight PWM brightness control */ -MX6_PAD_SD1_DAT3__PWM1_OUT |MUX_PAD_CTRL (NO_PAD_CTRL ), -}; +static void do_enable_backlight (struct display_info_t const *dev) +{ +struct udevice *panel; +int ret; + + ret =uclass_get_device (UCLASS_PANEL ,0 , &panel); +if (ret) { +printf ("Could not find panel: %d\n" , ret); +return ; + } + +panel_set_backlight (panel,100 ); +panel_enable_backlight (panel); +}static void do_enable_hdmi (struct display_info_t const *dev) {
@@ -155,7 +160,7 @@ struct display_info_t const displays[] = {{ .addr = -1, .pixfmt = IPU_PIX_FMT_RGB24, .detect = detect_lcd, - .enable = NULL, + .enable = do_enable_backlight, .mode = { .name = "G121X1-L03", .refresh = 60,
@@ -314,12 +319,6 @@ static void setup_display_bx50v3(void)IOMUXC_GPR3_LVDS0_MUX_CTL_MASK , (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 << IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET)); - -/* backlights off until needed */ -imx_iomux_v3_setup_multiple_pads (backlight_pads, -ARRAY_SIZE (backlight_pads)); -gpio_request (LVDS_POWER_GP ,"lvds_power" ); - gpio_direction_input(LVDS_POWER_GP); }#endif /* CONFIG_VIDEO_IPUV3 */
@@ -476,9 +475,6 @@ int board_init(void)setup_display_b850v3 (); elsesetup_display_bx50v3 (); - -gpio_request (LVDS_BACKLIGHT_GP ,"lvds_backlight" ); -gpio_direction_input (LVDS_BACKLIGHT_GP );#endif /* address of boot parameters */
@@ -590,51 +586,6 @@ int ft_board_setup(void *blob, bd_t *bd) }#endif -static int do_backlight_enable (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) -{ -#if CONFIG_IS_ENABLED (DM_VIDEO ) -int ret; -struct udevice *dev; - -#ifdef CONFIG_VIDEO_IPUV3 -if (!is_b850v3 ()) { -gpio_direction_output (LVDS_POWER_GP ,1 ); - -/* We need@least 200ms between power on and backlight on -* as per specifications from CHI MEI -*/ -mdelay (250 ); - -/* enable backlight PWM 1 */ -pwm_init (0 ,0 ,0 ); - -/* duty cycle 5000000ns, period: 5000000ns */ -pwm_config (0 ,5000000 ,5000000 ); - -/* Backlight Power */ -gpio_direction_output (LVDS_BACKLIGHT_GP ,1 ); - -pwm_enable (0 ); - } -#endif - -/* Probe, to find a video device to be used to show a message on -* the vidconsole. -*/ - ret =uclass_get_device (UCLASS_VIDEO ,0 , &dev); -if (ret) -return ret; -#endif - -return 0 ; -} - -U_BOOT_CMD ( - bx50_backlight_enable,1 ,1 , do_backlight_enable, -"enable Bx50 backlight" , -"" -); -int board_fit_config_name_match (const char *name) {if (!vpd.is_read)
configs/ge_bx50v3_defconfig +3 -0
@@ -30,6 +30,7 @@ CONFIG_CMD_PCI=y # CONFIG_CMD_NFS is not set CONFIG_CMD_BOOTCOUNT=y CONFIG_CMD_CACHE=y +CONFIG_CMD_CLS=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y
@@ -74,9 +75,11 @@ CONFIG_DM_PCI=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y CONFIG_PWM_IMX=y +CONFIG_DM_PWM=y CONFIG_DM_PMIC=y CONFIG_DM_PMIC_DA9063=y CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_DA9063=y CONFIG_DM_RTC=y CONFIG_RTC_RX8010SJ=y
include/configs/ge_bx50v3.h +1 -1
@@ -105,7 +105,7 @@"setexpr partnum 3 - ${partnum}\0" \"failbootcmd=" \"echo reached failbootcmd; " \ -"bx50_backlight_enable; " \ +"cls; " \"setcurs 5 4; " \"lcdputs \"Monitor failed to start. " \"Try again, or contact GE Service for support.\"; " \
Signature · 1 line
2.10.1
PATCH 8/13 board: ge: bx50v3: Enable DM PWM for backlight
Quoted 7 lines
From: Robert Beckett <[email protected]>
Add backlight and panel devicetree definitions
UseUCLASS_PANELto enable backlight via display enable handler Remove old explicit gpio code for handling backlight Use cls command to initiate display in HW agnostic manner Enable DM regulator and pwmSigned-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 9/13 board: ge: mx53ppd: Use DM for ethernet
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Remove legacy iomux setup for fec.
Enable phylib and DM fec.
Use Kconfig for enabling fec.
--- board/ge/mx53ppd/mx53ppd.c | 26 -------------------------- configs/mx53ppd_defconfig | 3 +++ include/configs/mx53ppd.h | 8 -------- 3 files changed, 3 insertions(+), 34 deletions(-)
board/ge/mx53ppd/mx53ppd.c +0 -26
@@ -98,31 +98,6 @@ int board_ehci_hcd_init(int port) }#endif -static void setup_iomux_fec (void ) -{ -static const iomux_v3_cfg_t fec_pads[] = { -NEW_PAD_CTRL (MX53_PAD_FEC_MDIO__FEC_MDIO ,PAD_CTL_HYS | -PAD_CTL_DSE_HIGH |PAD_CTL_PUS_22K_UP | -PAD_CTL_ODE ), -NEW_PAD_CTRL (MX53_PAD_FEC_MDC__FEC_MDC ,PAD_CTL_DSE_HIGH ), -NEW_PAD_CTRL (MX53_PAD_FEC_RXD1__FEC_RDATA_1 , -PAD_CTL_HYS |PAD_CTL_PKE ), -NEW_PAD_CTRL (MX53_PAD_FEC_RXD0__FEC_RDATA_0 , -PAD_CTL_HYS |PAD_CTL_PKE ), -NEW_PAD_CTRL (MX53_PAD_FEC_TXD1__FEC_TDATA_1 ,PAD_CTL_DSE_HIGH ), -NEW_PAD_CTRL (MX53_PAD_FEC_TXD0__FEC_TDATA_0 ,PAD_CTL_DSE_HIGH ), -NEW_PAD_CTRL (MX53_PAD_FEC_TX_EN__FEC_TX_EN ,PAD_CTL_DSE_HIGH ), -NEW_PAD_CTRL (MX53_PAD_FEC_REF_CLK__FEC_TX_CLK , -PAD_CTL_HYS |PAD_CTL_PKE ), -NEW_PAD_CTRL (MX53_PAD_FEC_RX_ER__FEC_RX_ER , -PAD_CTL_HYS |PAD_CTL_PKE ), -NEW_PAD_CTRL (MX53_PAD_FEC_CRS_DV__FEC_RX_DV , -PAD_CTL_HYS |PAD_CTL_PKE ), - }; - -imx_iomux_v3_setup_multiple_pads (fec_pads,ARRAY_SIZE (fec_pads)); -} -static int clock_1GHz (void ) {int ret;
@@ -160,7 +135,6 @@ void ppd_gpio_init(void)int board_early_init_f (void ) { -setup_iomux_fec ();ppd_gpio_init ();return 0 ;
configs/mx53ppd_defconfig +3 -0
@@ -49,6 +49,9 @@ CONFIG_I2C_EEPROM=y CONFIG_DM_MMC=y CONFIG_FSL_ESDHC_IMX=y CONFIG_MTD=y +CONFIG_PHYLIB=y +CONFIG_DM_ETH=y +CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX5=y
include/configs/mx53ppd.h +0 -8
@@ -28,12 +28,6 @@#define CONFIG_MXC_UART #define CONFIG_MXC_UART_BASE UART1_BASE -/* Eth Configs */ - -#define CONFIG_FEC_MXC -#define IMX_FEC_BASE FEC_BASE_ADDR -#define CONFIG_FEC_MXC_PHYADDR 0x1F -/* USB Configs */ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX
@@ -49,8 +43,6 @@/* Command definition */ -#define CONFIG_ETHPRIME "FEC0" -#define CONFIG_LOADADDR 0x72000000/* loadaddr env var */ #define PPD_CONFIG_NFS \
Signature · 1 line
2.10.1
PATCH 9/13 board: ge: mx53ppd: Use DM for ethernet
Quoted 5 lines
From: Robert Beckett <[email protected]>
Remove legacy iomux setup for fec.
Enable phylib and DM fec.
UseKconfigfor enabling fec.Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 10/13 board: ge: bx50v3: use DM for uart
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Remove legacy uart pad and iomux code
Enable DM serial and mxc uart
--- board/ge/bx50v3/bx50v3.c | 24 ------------------------ configs/ge_bx50v3_defconfig | 3 +++ include/configs/ge_bx50v3.h | 10 ++-------- 3 files changed, 5 insertions(+), 32 deletions(-)
board/ge/bx50v3/bx50v3.c +0 -24
@@ -48,10 +48,6 @@ static struct vpd_cache vpd; PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ PAD_CTL_HYS) -#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ - PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ - PAD_CTL_SRE_FAST | PAD_CTL_HYS) -#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \ PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST)
@@ -74,24 +70,6 @@ int dram_init(void)return 0 ; } -static iomux_v3_cfg_t const uart3_pads[] = { -MX6_PAD_EIM_D31__UART3_RTS_B |MUX_PAD_CTRL (UART_PAD_CTRL ), -MX6_PAD_EIM_D23__UART3_CTS_B |MUX_PAD_CTRL (UART_PAD_CTRL ), -MX6_PAD_EIM_D24__UART3_TX_DATA |MUX_PAD_CTRL (UART_PAD_CTRL ), -MX6_PAD_EIM_D25__UART3_RX_DATA |MUX_PAD_CTRL (UART_PAD_CTRL ), -}; - -static iomux_v3_cfg_t const uart4_pads[] = { -MX6_PAD_KEY_COL0__UART4_TX_DATA |MUX_PAD_CTRL (UART_PAD_CTRL ), -MX6_PAD_KEY_ROW0__UART4_RX_DATA |MUX_PAD_CTRL (UART_PAD_CTRL ), -}; - -static void setup_iomux_uart (void ) -{ -imx_iomux_v3_setup_multiple_pads (uart3_pads,ARRAY_SIZE (uart3_pads)); -imx_iomux_v3_setup_multiple_pads (uart4_pads,ARRAY_SIZE (uart4_pads)); -} -static int mx6_rgmii_rework (struct phy_device *phydev) {/* Configure AR8033 to ouput a 125MHz clk from CLK_25M */
@@ -425,8 +403,6 @@ int board_early_init_f(void)imx_iomux_v3_setup_multiple_pads (misc_pads,ARRAY_SIZE (misc_pads)); -setup_iomux_uart (); -#if defined(CONFIG_VIDEO_IPUV3 )/* Set LDB clock to Video PLL */ select_ldb_di_clock_source (MXC_PLL5_CLK );
configs/ge_bx50v3_defconfig +3 -0
@@ -83,6 +83,9 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_DA9063=y CONFIG_DM_RTC=y CONFIG_RTC_RX8010SJ=y +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_DM_SERIAL=y +CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MXC_SPI=y
include/configs/ge_bx50v3.h +2 -8
@@ -16,9 +16,6 @@#define CONFIG_BOARD_NAME "General Electric Bx50v3" -#define CONFIG_MXC_UART_BASE UART3_BASE -#define CONSOLE_DEV "ttymxc2" -#include "mx6_common.h" #include <linux/sizes.h>
@@ -28,8 +25,6 @@#define CONFIG_REVISION_TAG #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) -#define CONFIG_MXC_UART -/* SATA Configs */ #ifdef CONFIG_CMD_SATA #define CONFIG_SYS_SATA_MAX_DEVICE 1
@@ -64,7 +59,7 @@"setenv netmask 255.255.255.0; setenv ethaddr ca:fe:de:ca:f0:11; " \"setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:/srv/nfs/,v3,tcp rw rootwait" \"setenv bootargs $bootargs ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}::eth0:off " \ -"setenv bootargs $bootargs cma=128M bootcause=POR console=${console} ${videoargs} " \ +"setenv bootargs $bootargs cma=128M bootcause=POR ${videoargs} " \"setenv bootargs $bootargs systemd.mask=helix-network-defaults.service " \"setenv bootargs $bootargs watchdog.handle_boot_enabled=1\0" \"networkboot=" \
@@ -89,11 +84,10 @@"devnum=2\0" \"rootdev=mmcblk0p\0" \"quiet=quiet loglevel=0\0" \ -"console=" CONSOLE_DEV "\0" \"setargs=setenv bootargs root=/dev/${rootdev}${partnum} " \"ro rootwait cma=128M " \"bootcause=${bootcause} " \ -"${quiet} console=${console} " \ +"${quiet} " \"${videoargs}" "\0" \"doquiet=" \"if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
Signature · 1 line
2.10.1
PATCH 10/13 board: ge: bx50v3: use DM for uart
Quoted 4 lines
From: Robert Beckett <[email protected]> Remove legacy uart pad and iomux code Enable DM serial and mxc uart
Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 11/13 board: ge: mx53ppd: use DM for uart
In reply to Ian RayDrop PPD_UART_PAD_CTRL since it matches defaults.
Enable DM serial and MXC uart.
--- board/ge/mx53ppd/mx53ppd.c | 3 --- board/ge/mx53ppd/ppd_gpio.h | 6 ------ configs/mx53ppd_defconfig | 3 +++ include/configs/mx53ppd.h | 9 +-------- 4 files changed, 4 insertions(+), 17 deletions(-)
board/ge/mx53ppd/mx53ppd.c +0 -3
@@ -85,9 +85,6 @@ u32 get_board_rev(void)return get_cpu_rev () & ~(0xF <<8 ); } -#define UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \ - PAD_CTL_PUS_100K_UP | PAD_CTL_ODE) -#ifdef CONFIG_USB_EHCI_MX5 int board_ehci_hcd_init (int port) {
board/ge/mx53ppd/ppd_gpio.h +0 -6
@@ -9,15 +9,9 @@#include <asm/arch/iomux-mx53.h> #include <asm/gpio.h> -#define PPD_UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \ - PAD_CTL_PUS_100K_UP) -static const iomux_v3_cfg_t ppd_pads[] = {/* FEC */ MX53_PAD_EIM_A22__GPIO2_16 , -/* UART */ -NEW_PAD_CTRL (MX53_PAD_PATA_DMACK__UART1_RXD_MUX ,PPD_UART_PAD_CTRL ), -NEW_PAD_CTRL (MX53_PAD_PATA_DIOW__UART1_TXD_MUX ,PPD_UART_PAD_CTRL ),/* Video */ MX53_PAD_CSI0_DATA_EN__GPIO5_20 ,/* LR_SCAN_CTRL */ MX53_PAD_CSI0_VSYNC__GPIO5_21 ,/* UD_SCAN_CTRL */
configs/mx53ppd_defconfig +3 -0
@@ -60,6 +60,9 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_PWM_IMX=y CONFIG_DM_RTC=y CONFIG_RTC_S35392A=y +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_DM_SERIAL=y +CONFIG_MXC_UART=y CONFIG_SYSRESET=y CONFIG_SYSRESET_WATCHDOG=y CONFIG_USB=y
include/configs/mx53ppd.h +1 -8
@@ -11,8 +11,6 @@#include <asm/arch/imx-regs.h> -#define CONSOLE_DEV "ttymxc0" -#define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG
@@ -25,9 +23,6 @@#define CONFIG_BOARD_LATE_INIT #define CONFIG_REVISION_TAG -#define CONFIG_MXC_UART -#define CONFIG_MXC_UART_BASE UART1_BASE -/* USB Configs */ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX
@@ -70,11 +65,9 @@"devnum=2\0" \"rootdev=mmcblk0p\0" \"quiet=quiet loglevel=0\0" \ -"console=" CONSOLE_DEV "\0" \"lvds=ldb\0" \"setargs=setenv bootargs ${lvds} jtag=on mem=2G " \ -"vt.global_cursor_default=0 bootcause=${bootcause} ${quiet} " \ -"console=${console}\0" \ +"vt.global_cursor_default=0 bootcause=${bootcause} ${quiet}\0" \"bootargs_emmc=setenv bootargs root=/dev/${rootdev}${partnum} ro " \"rootwait ${bootargs}\0" \"doquiet=if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
Signature · 1 line
2.10.1
PATCH 11/13 board: ge: mx53ppd: use DM for uart
Quoted 4 lines
Drop
PPD_UART_PAD_CTRLsince it matches defaults. Enable DM serial and MXC uart.Signed-off-by Ian Ray <[email protected]>Signed-off-by Robert Beckett <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 12/13 board: ge: bx50v3, mx53ppd: fix firstboot detection
In reply to Ian RayFrom: Robert Beckett <[email protected]>
Use test' command to test for file existence instead of relying on the old functionality of the ext2load' command (which now reports an error when attempting to load a zero length file).
--- include/configs/ge_bx50v3.h | 3 +-- include/configs/mx53ppd.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
include/configs/ge_bx50v3.h +1 -2
@@ -93,8 +93,7 @@"if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \"then setenv quiet; fi\0" \"hasfirstboot=" \ -"ext2load ${dev} ${devnum}:${partnum} 0x7000A000 " \ -"/boot/bootcause/firstboot\0" \ +"test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \"swappartitions=" \"setexpr partnum 3 - ${partnum}\0" \"failbootcmd=" \
include/configs/mx53ppd.h +2 -2
@@ -72,8 +72,8 @@"rootwait ${bootargs}\0" \"doquiet=if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \"then setenv quiet; fi\0" \ -"hasfirstboot=ext2load ${dev} ${devnum}:${partnum} 0x7000A000 " \ -"/boot/bootcause/firstboot\0" \ +"hasfirstboot=" \ +"test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \"swappartitions=setexpr partnum 3 - ${partnum}\0" \"failbootcmd=" \"cls; " \
Signature · 1 line
2.10.1
PATCH 12/13 board: ge: bx50v3, mx53ppd: fix firstboot detection
Quoted 6 lines
From: Robert Beckett <[email protected]>
Usetest' command to test for file existence instead of relying on the old functionality of theext2load' command (which now reports an error when attempting to load a zero length file).Signed-off-by Robert Beckett <[email protected]>Signed-off-by Ian Ray <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 13/13 board: ge: bx50v3, imx53ppd: configure CONFIG_SYS_BOOTMAPSZ
In reply to Ian RayConfigure `CONFIG_SYS_BOOTMAPSZ' per guidance on u-boot at lists.denx.de.
--- include/configs/ge_bx50v3.h | 3 ++- include/configs/mx53ppd.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
include/configs/ge_bx50v3.h +2 -1
@@ -79,7 +79,6 @@NETWORKBOOT \"bootcause=POR\0" \"image=/boot/fitImage\0" \ -"fdt_high=0xffffffff\0" \"dev=mmc\0" \"devnum=2\0" \"rootdev=mmcblk0p\0" \
@@ -154,6 +153,8 @@/* Physical Memory Map */ #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR +#define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* 256M */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
include/configs/mx53ppd.h +2 -1
@@ -60,7 +60,6 @@#define CONFIG_EXTRA_ENV_SETTINGS \ PPD_CONFIG_NFS \ "image=/boot/fitImage\0" \ - "fdt_high=0xffffffff\0" \ "dev=mmc\0" \ "devnum=2\0" \ "rootdev=mmcblk0p\0" \
@@ -127,6 +126,8 @@#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* 256M */ +/* Physical Memory Map */ #define PHYS_SDRAM_1 CSD0_BASE_ADDR#define PHYS_SDRAM_1_SIZE (gd->bd->bi_dram[0].size)
Signature · 1 line
2.10.1
PATCH 13/13 board: ge: bx50v3, imx53ppd: configure CONFIG_SYS_BOOTMAPSZ
Quoted 2 lines
Configure `CONFIG_SYS_BOOTMAPSZ' per guidance on u-boot at lists.denx.de.
Signed-off-by Ian Ray <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================