configs: imx8mm_venice_defconfig: remove unused SPL features
Subsystems (2)
PATCH 1/9 configs: imx8mm_venice_defconfig: remove unused SPL features
remove unused SPL features to shink the size of the SPL which otherwise would no longer fit into IMX8M Mini OCRAM.
--- configs/imx8mm_venice_defconfig | 2 -- 1 file changed, 2 deletions(-)
configs/imx8mm_venice_defconfig +0 -2
@@ -26,7 +26,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_LOAD_FIT_FULL=y CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" CONFIG_OF_SYSTEM_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg"
@@ -36,7 +35,6 @@ CONFIG_PREBOOT="gsc wd-disable" CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_I2C_SUPPORT=y -CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_PROMPT="u-boot=> " # CONFIG_CMD_EXPORTENV is not set
Signature · 1 line
2.17.1
PATCH 2/9 arm: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS
The GW71xx has a USB Type-C connector with USB 2.0 signaling. GPIO1_12 is the power-enable to the TPS25821 Source controller and power switch responsible for monitoring the CC pins and enabling VBUS. Therefore GPIO1_12 must always be enabled and the vbus output enable from the IMX8MM can be ignored.
To fix USB OTG VBUS enable a pull-up on GPIO1_12 to always power the TPS25821 and change the regulator output to GPIO1_10 which is unconnected.
--- arch/arm/dts/imx8mm-venice-gw71xx.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/dts/imx8mm-venice-gw71xx.dtsi +3 -2
@@ -46,7 +46,7 @@ pinctrl-0 = <&pinctrl_reg_usb1_en>; compatible = "regulator-fixed"; regulator-name = "usb_otg1_vbus"; - gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>;
@@ -156,7 +156,8 @@ pinctrl_reg_usb1_en: regusb1grp { fsl,pins = < - MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x41 + MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x41 + MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 >; };
Signature · 1 line
2.17.1
PATCH 3/9 arm: dts: imx8mm-venice-gw700x: fix fifo-depth phy props
In reply to Tim HarveyReplace the deprecated 'tx-fifo-depth' and 'rx-fifo-depth' properties not supported by U-Boot drivers/net/phy/dp83867.c with the proper 'ti,fifo-depth' property.
--- arch/arm/dts/imx8mm-venice-gw700x.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/dts/imx8mm-venice-gw700x.dtsi +1 -2
@@ -111,8 +111,7 @@ reg = <0>; ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; - tx-fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; - rx-fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; }; }; };
Signature · 1 line
2.17.1
PATCH 4/9 arm: dts: imx8mm-venice-gw7901: use common u-boot dtsi
In reply to Tim HarveyUse the common imx8mm-u-boot.dtsi
--- arch/arm/dts/imx8mm-venice-gw7901-u-boot.dtsi | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-)
arch/arm/dts/imx8mm-venice-gw7901-u-boot.dtsi +1 -34
@@ -3,40 +3,7 @@ * Copyright 2020 Gateworks Corporation */ -&{/soc@0} { - u-boot,dm-pre-reloc; - u-boot,dm-spl; -}; - -&clk { - u-boot,dm-spl; - u-boot,dm-pre-reloc; - /delete-property/ assigned-clocks; - /delete-property/ assigned-clock-parents; - /delete-property/ assigned-clock-rates; -}; - -&osc_24m { - u-boot,dm-spl; - u-boot,dm-pre-reloc; -}; - -&aips1 { - u-boot,dm-spl; - u-boot,dm-pre-reloc; -}; - -&aips2 { - u-boot,dm-spl; -}; - -&aips3 { - u-boot,dm-spl; -}; - -&iomuxc { - u-boot,dm-spl; -}; +#include "imx8mm-u-boot.dtsi" &gpio1 { u-boot,dm-spl;
Signature · 1 line
2.17.1
PATCH 5/9 board: gateworks: venice: get mem size from dt
In reply to Tim HarveyGet mem size from dt which SPL updated per EEPROM config.
--- board/gateworks/venice/imx8mm_venice.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-)
board/gateworks/venice/imx8mm_venice.c +14 -14
@@ -13,6 +13,7 @@#include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> #include <asm/io.h> +#include <asm/unaligned.h> #include "gsc.h"
@@ -20,20 +21,19 @@ DECLARE_GLOBAL_DATA_PTR;int board_phys_sdram_size (phys_size_t *size) { -int ddr_size =readl (M4_BOOTROM_BASE_ADDR ); - -if (ddr_size ==0x4 ) { - *size =0x100000000 ; - }else if (ddr_size ==0x3 ) { - *size =0xc0000000 ; - }else if (ddr_size ==0x2 ) { - *size =0x80000000 ; - }else if (ddr_size ==0x1 ) { - *size =0x40000000 ; - }else { -printf ("Unknown DDR type!!!\n" ); - *size =0x40000000 ; - } +const fdt64_t *val; +int offset; +int len; + +/* get size from dt which SPL updated per EEPROM config */ + offset =fdt_path_offset (gd->fdt_blob,"/memory" ); +if (offset <0 ) +return -EINVAL ; + + val =fdt_getprop (gd->fdt_blob, offset,"reg" , &len); +if (len <sizeof (*val) *2 ) +return -EINVAL ; + *size =get_unaligned_be64 (&val[1 ]);return 0 ; }
Signature · 1 line
2.17.1
PATCH 6/9 board: gateworks: venice: use bus numbers vs names
In reply to Tim Harveyreplace looking up i2c bus name by bus number and define bus numbers and eeprom address with #defines.
--- board/gateworks/venice/gsc.c | 19 ++++++++++--------- board/gateworks/venice/gsc.h | 5 +++++ board/gateworks/venice/spl.c | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-)
board/gateworks/venice/gsc.c +10 -9
@@ -123,13 +123,13 @@ enum { GSC_SC_RST_CAUSE_MAX = 10, }; +#include <dm/device.h> static struct udevice *gsc_get_dev (int busno,int slave) { -static const char *const i2c[] = {"i2c@30a20000" ,"i2c@30a30000" };struct udevice *dev, *bus;int ret; - ret =uclass_get_device_by_name (UCLASS_I2C , i2c[busno -1 ], &bus); + ret =uclass_get_device_by_seq (UCLASS_I2C , busno, &bus);if (ret) {printf ("GSC : failed I2C%d probe: %d\n" , busno, ret);return NULL ;
@@ -246,7 +246,7 @@ int gsc_hwmon(void)return node;/* probe device */ - dev =gsc_get_dev (1 ,GSC_HWMON_ADDR ); + dev =gsc_get_dev (GSC_BUSNO ,GSC_HWMON_ADDR );if (!dev) {puts ("ERROR: Failed to probe GSC HWMON\n" );return -ENODEV ;
@@ -453,14 +453,15 @@ static int gsc_read(void) {int ret; - ret =gsc_read_eeprom (1 ,GSC_EEPROM_ADDR ,1 , &som_info); + ret =gsc_read_eeprom (GSC_BUSNO ,GSC_EEPROM_ADDR ,1 , &som_info);if (ret) {memset (&som_info,0 ,sizeof (som_info));return ret; }/* read optional baseboard EEPROM */ -return gsc_read_eeprom (2 ,0x52 ,2 , &base_info); +return gsc_read_eeprom (BASEBOARD_EEPROM_BUSNO ,BASEBOARD_EEPROM_ADDR , +2 , &base_info); }static int gsc_info (int verbose)
@@ -518,7 +519,7 @@ static int gsc_info(int verbose)/* Display RTC */ puts ("RTC : " ); - dev =gsc_get_dev (1 ,GSC_RTC_ADDR ); + dev =gsc_get_dev (GSC_BUSNO ,GSC_RTC_ADDR );if (!dev) {puts ("Failed to probe GSC RTC\n" ); }else {
@@ -542,7 +543,7 @@ int gsc_init(int quiet)*/ while (1 ) {/* probe device */ - dev =gsc_get_dev (1 ,GSC_SC_ADDR ); + dev =gsc_get_dev (GSC_BUSNO ,GSC_SC_ADDR );if (dev)break ;mdelay (1 );
@@ -583,7 +584,7 @@ static int gsc_sleep(unsigned long secs)int ret;/* probe device */ - dev =gsc_get_dev (1 ,GSC_SC_ADDR ); + dev =gsc_get_dev (GSC_BUSNO ,GSC_SC_ADDR );if (!dev)return -ENODEV ;
@@ -631,7 +632,7 @@ static int gsc_boot_wd_disable(void)int ret;/* probe device */ - dev =gsc_get_dev (1 ,GSC_SC_ADDR ); + dev =gsc_get_dev (GSC_BUSNO ,GSC_SC_ADDR );if (!dev)return -ENODEV ;
board/gateworks/venice/gsc.h +5 -0
@@ -6,11 +6,16 @@ #ifndef _GSC_H_ #define _GSC_H_ +/* I2C bus numbers */ +#define GSC_BUSNO 0 +#define BASEBOARD_EEPROM_BUSNO 1 + /* I2C slave addresses */ #define GSC_SC_ADDR 0x20 #define GSC_RTC_ADDR 0x68 #define GSC_HWMON_ADDR 0x29 #define GSC_EEPROM_ADDR 0x51 +#define BASEBOARD_EEPROM_ADDR 0x52 struct venice_board_info { u8 mac[6]; /* 0x00: MAC base */
board/gateworks/venice/spl.c +2 -2
@@ -116,7 +116,7 @@ static int power_init_board(void)if ((!strncmp (model,"GW71" ,4 )) || (!strncmp (model,"GW72" ,4 )) || (!strncmp (model,"GW73" ,4 ))) { - ret =uclass_get_device_by_name (UCLASS_I2C ,"i2c@30a20000" , &bus); + ret =uclass_get_device_by_seq (UCLASS_I2C ,0 , &bus);if (ret) {printf ("PMIC : failed I2C1 probe: %d\n" , ret);return ret;
@@ -134,7 +134,7 @@ static int power_init_board(void) }else if (!strncmp (model,"GW7901" ,6 )) { - ret =uclass_get_device_by_name (UCLASS_I2C ,"i2c@30a30000" , &bus); + ret =uclass_get_device_by_seq (UCLASS_I2C ,1 , &bus);if (ret) {printf ("PMIC : failed I2C2 probe: %d\n" , ret);return ret;
Signature · 1 line
2.17.1
PATCH 7/9 board: gateworks: venice: add board model/serial# to env
In reply to Tim HarveyAdd board model/serial# strings to env. Move the creation of the strings to gsc_read() and the display of the info into gsc_info() so they are available to U-Boot proper.
--- board/gateworks/venice/gsc.c | 67 ++++++++++++++------------ board/gateworks/venice/gsc.h | 1 + board/gateworks/venice/imx8mm_venice.c | 4 ++ 3 files changed, 41 insertions(+), 31 deletions(-)
board/gateworks/venice/gsc.c +36 -31
@@ -18,6 +18,7 @@ DECLARE_GLOBAL_DATA_PTR;struct venice_board_info som_info;struct venice_board_info base_info;char venice_model[32 ]; +uint32_t venice_serial;/* return a mac address from EEPROM info */ int gsc_getmac (int index,uint8_t *address)
@@ -451,6 +452,8 @@ const char *gsc_get_dtb_name(int level, char *buf, int sz)static int gsc_read (void ) { +char rev_pcb; +int rev_bom;int ret; ret =gsc_read_eeprom (GSC_BUSNO ,GSC_EEPROM_ADDR ,1 , &som_info);
@@ -460,25 +463,11 @@ static int gsc_read(void) }/* read optional baseboard EEPROM */ -return gsc_read_eeprom (BASEBOARD_EEPROM_BUSNO ,BASEBOARD_EEPROM_ADDR , -2 , &base_info); -} +gsc_read_eeprom (BASEBOARD_EEPROM_BUSNO ,BASEBOARD_EEPROM_ADDR , +2 , &base_info); -static int gsc_info (int verbose) -{ -struct udevice *dev; -unsigned char buf[16 ]; -char rev_pcb; -int rev_bom; - -if (!base_info.model[0 ]) { -strcpy (venice_model, som_info.model); -printf ("Model : %s\n" , som_info.model); -printf ("Serial : %d\n" , som_info.serial); -printf ("MFGDate : %02x-%02x-%02x%02x\n" , - som_info.mfgdate[0 ], som_info.mfgdate[1 ], - som_info.mfgdate[2 ], som_info.mfgdate[3 ]); - }else { +/* create model strings */ +if (base_info.model[0 ]) { sprintf(venice_model, "GW%c%c%c%c-%c%c-", som_info.model[2], /* family */ base_info.model[3], /* baseboard */
@@ -499,22 +488,33 @@ static int gsc_info(int verbose)sprintf (venice_model +strlen (venice_model),"%c%d" , rev_pcb, rev_bom); else sprintf(venice_model + strlen(venice_model), "%c", rev_pcb); + }else { +strcpy (venice_model, som_info.model); + } + venice_serial = som_info.serial; -if (verbose >1 ) { -printf ("SOM : %s %d %02x-%02x-%02x%02x\n" , - som_info.model, som_info.serial, - som_info.mfgdate[0 ], som_info.mfgdate[1 ], - som_info.mfgdate[2 ], som_info.mfgdate[3 ]); -printf ("BASE : %s %d %02x-%02x-%02x%02x\n" , - base_info.model, base_info.serial, - base_info.mfgdate[0 ], base_info.mfgdate[1 ], - base_info.mfgdate[2 ], base_info.mfgdate[3 ]); - } -printf ("Model : %s\n" , venice_model); -printf ("Serial : %d\n" , som_info.serial); -printf ("MFGDate : %02x-%02x-%02x%02x\n" , +return 0 ; +} + +static int gsc_info (int verbose) +{ +struct udevice *dev; +unsigned char buf[16 ]; + +printf ("Model : %s\n" , venice_model); +printf ("Serial : %d\n" , som_info.serial); +printf ("MFGDate : %02x-%02x-%02x%02x\n" , + som_info.mfgdate[0 ], som_info.mfgdate[1 ], + som_info.mfgdate[2 ], som_info.mfgdate[3 ]); +if (base_info.model[0 ] && verbose >1 ) { +printf ("SOM : %s %d %02x-%02x-%02x%02x\n" , + som_info.model, som_info.serial, som_info.mfgdate[0 ], som_info.mfgdate[1 ], som_info.mfgdate[2 ], som_info.mfgdate[3 ]); +printf ("BASE : %s %d %02x-%02x-%02x%02x\n" , + base_info.model, base_info.serial, + base_info.mfgdate[0 ], base_info.mfgdate[1 ], + base_info.mfgdate[2 ], base_info.mfgdate[3 ]); }/* Display RTC */
@@ -576,6 +576,11 @@ const char *gsc_get_model(void)return venice_model; } +uint32_t gsc_get_serial (void ) +{ +return venice_serial; +} +#if !(IS_ENABLED (CONFIG_SPL_BUILD ))static int gsc_sleep (unsigned long secs) {
board/gateworks/venice/gsc.h +1 -0
@@ -40,5 +40,6 @@ int gsc_hwmon(void);const char *gsc_get_model (void );const char *gsc_get_dtb_name (int level,char *buf,int len);int gsc_getmac (int index,uint8_t *enetaddr); +uint32_t gsc_get_serial (void );#endif
board/gateworks/venice/imx8mm_venice.c +4 -0
@@ -113,6 +113,10 @@ int board_late_init(void)led_default_state (); +/* Set board serial/model */ +env_set_ulong ("serial#" ,gsc_get_serial ()); +env_set ("model" ,gsc_get_model ()); +/* Set fdt_file vars */ i =0 ; do {
Signature · 1 line
2.17.1
PATCH 8/9 board: gateworks: venice: add board model to dt
In reply to Tim HarveyAdd the specific board model from EEPROM config to the device-tree to make it easier to access from Linux userspace.
--- board/gateworks/venice/imx8mm_venice.c | 8 ++++++++ configs/imx8mm_venice_defconfig | 1 + 2 files changed, 9 insertions(+)
board/gateworks/venice/imx8mm_venice.c +8 -0
@@ -152,3 +152,11 @@ int board_mmc_get_env_dev(int devno) {return devno; } + +int ft_board_setup (void *blob,struct bd_info *bd) +{ +/* set board model dt prop */ +fdt_setprop_string (blob,0 ,"board" ,gsc_get_model ()); + +return 0 ; +}
configs/imx8mm_venice_defconfig +1 -0
@@ -27,6 +27,7 @@ CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +CONFIG_OF_BOARD_SETUP=y CONFIG_OF_SYSTEM_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" # CONFIG_USE_BOOTCOMMAND is not set
Signature · 1 line
2.17.1
PATCH 9/9 board: gateworks: venice: add imx8mm-gw7902 support
In reply to Tim HarveyThe GW7902 is based on the i.MX 8M Mini / Nano SoC featuring:
- LPDDR4 DRAM
- eMMC FLASH
- Gateworks System Controller
- LTE CAT M1 modem
- USB 2.0 HUB
- M.2 Socket with USB2.0, PCIe, and dual-SIM
- IMX8M FEC
- PCIe based GbE
- RS232/RS485/RS422 serial transceiver
- GPS
- CAN bus
- WiFi / Bluetooth
- MIPI header (DSI/CSI/GPIO/PWM/I2S)
- PMIC
Do the following to add support for it:
- add dts
- add PMIC config
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/imx8mm-venice-gw7902-u-boot.dtsi | 80 ++ arch/arm/dts/imx8mm-venice-gw7902.dts | 927 ++++++++++++++++++ board/gateworks/venice/lpddr4_timing.c | 516 ++++++++++ board/gateworks/venice/lpddr4_timing.h | 1 + board/gateworks/venice/spl.c | 11 +- configs/imx8mm_venice_defconfig | 2 +- 7 files changed, 1535 insertions(+), 3 deletions(-) create mode 100644 arch/arm/dts/imx8mm-venice-gw7902-u-boot.dtsi create mode 100644 arch/arm/dts/imx8mm-venice-gw7902.dts
arch/arm/dts/Makefile +1 -0
@@ -869,6 +869,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \ imx8mm-venice-gw72xx-0x.dtb \ imx8mm-venice-gw73xx-0x.dtb \ imx8mm-venice-gw7901.dtb \ + imx8mm-venice-gw7902.dtb \ imx8mm-verdin.dtb \ phycore-imx8mm.dtb \ imx8mn-ddr4-evk.dtb \
arch/arm/dts/imx8mm-venice-gw7902-u-boot.dtsi new file +80 -0
80 lines not on this page · raw message
arch/arm/dts/imx8mm-venice-gw7902.dts new file +927 -0
927 lines not on this page · raw message
board/gateworks/venice/lpddr4_timing.c +516 -0
519 lines not on this page · raw message
board/gateworks/venice/lpddr4_timing.h +1 -0
@@ -7,6 +7,7 @@#define __LPDDR4_TIMING_H__extern struct dram_timing_info dram_timing_1gb; +extern struct dram_timing_info dram_timing_2gb;extern struct dram_timing_info dram_timing_4gb;#endif /* __LPDDR4_TIMING_H__ */
board/gateworks/venice/spl.c +9 -2
@@ -44,6 +44,9 @@ static void spl_dram_init(int size)case 1 : dram_timing = &dram_timing_1gb;break ; +case 2 : + dram_timing = &dram_timing_2gb; +break ;case 4 : dram_timing = &dram_timing_4gb;break ;
@@ -133,8 +136,12 @@ static int power_init_board(void) BIT(7) | MP5416_VSET_SW3_SVAL(920000)); } -else if (!strncmp (model,"GW7901" ,6 )) { - ret =uclass_get_device_by_seq (UCLASS_I2C ,1 , &bus); +else if ((!strncmp (model,"GW7901" ,6 )) || + (!strncmp (model,"GW7902" ,6 ))) { +if (!strncmp (model,"GW7901" ,6 )) + ret =uclass_get_device_by_seq (UCLASS_I2C ,1 , &bus); +else + ret =uclass_get_device_by_seq (UCLASS_I2C ,0 , &bus);if (ret) {printf ("PMIC : failed I2C2 probe: %d\n" , ret);return ret;
configs/imx8mm_venice_defconfig +1 -1
@@ -57,7 +57,7 @@ CONFIG_CMD_EXT4_WRITE=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y -CONFIG_OF_LIST="imx8mm-venice-gw71xx-0x imx8mm-venice-gw72xx-0x imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901" +CONFIG_OF_LIST="imx8mm-venice-gw71xx-0x imx8mm-venice-gw72xx-0x imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901 imx8mm-venice-gw7902" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
Signature · 1 line
2.17.1