Skip to contentSkip to conversation

board: k+p: Minor adjustments for K+P imx53 boards

PATCH New Lukasz Majewski 1 participant 7 messages May 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover board: k+p: Minor adjustments for K+P imx53 boards

This patch series include minor adjustments for imx53 boards.

Travis-CI:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/381036307

Lukasz Majewski (6):
board: imx53: Always disable display before starting kernel
board: Adjust K+P script to run misc (per board) adjustments
board: Add support for KEY1 status detection on K+P's HSC|DDC boards
board: Silent out the console on the K+P's imx53 boards
board: Remove not needed function for the K+P's imx53 board
config: Update defconfig for imx53 K+P boards

 arch/arm/dts/imx53-kp.dts         |  4 ++++
 board/k+p/bootscripts/tpcboot.cmd |  6 ++++++
 board/k+p/kp_imx53/kp_imx53.c     | 34 ++++++++++++++++++++++------------
 configs/kp_imx53_defconfig        |  6 +++++-
 include/configs/kp_imx53.h        |  1 +
 5 files changed, 38 insertions(+), 13 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/6 board: imx53: Always disable display before starting kernel

This patch prevents from the situation where we may end up with garbage displayed on the LCD panel.

Such situation occurs when one performs "reboot -f" in Linux and then stop in U-boot (or observe the garbage on the screen during boot up).

To prevent from such situation - the PWM pin is configured as GPIO and set to LOW.

---

 arch/arm/dts/imx53-kp.dts     | 2 ++
 board/k+p/kp_imx53/kp_imx53.c | 8 ++++++++
 2 files changed, 10 insertions(+)
arch/arm/dts/imx53-kp.dts +2 -0
index fd64a9f2f6..6322ef1323 100644
@@ -86,6 +86,8 @@
 				MX53_PAD_PATA_DA_2__GPIO7_8 0x1e4
 				/* BOOSTER_OFF */
 				MX53_PAD_EIM_CS0__GPIO2_23 0x1e4
+				/* LCD BACKLIGHT */
+				MX53_PAD_GPIO_1__GPIO1_1 0x1e4
 			>;
 		};
 
board/k+p/kp_imx53/kp_imx53.c +8 -0
index c80eed36c6..6b0db6b8de 100644
@@ -22,6 +22,7 @@
 #define VBUS_PWR_EN IMX_GPIO_NR(7, 8)
 #define PHY_nRST IMX_GPIO_NR(7, 6)
 #define BOOSTER_OFF IMX_GPIO_NR(2, 23)
+#define LCD_BACKLIGHT IMX_GPIO_NR(1, 1)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -189,10 +190,17 @@ void eth_phy_reset(void)
 	udelay(50);
 }
 
+void board_disable_display(void)
+{
+	gpio_request(LCD_BACKLIGHT, "LCD_BACKLIGHT");
+	gpio_direction_output(LCD_BACKLIGHT, 0);
+}
+
 int board_late_init(void)
 {
 	int ret = 0;
 
+	board_disable_display();
 	setup_ups();
 
 	if (!power_init())
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/6 board: Adjust K+P script to run misc (per board) adjustments

In reply to Lukasz Majewski

This change gives the opportunity to adjust Linux command line for the imx53 device with some legacy data.

---

 board/k+p/bootscripts/tpcboot.cmd | 6 ++++++
 1 file changed, 6 insertions(+)
board/k+p/bootscripts/tpcboot.cmd +6 -0
index eac79dc890..16b93ebe3f 100644
@@ -23,6 +23,10 @@ setenv mmcroot "/dev/mmcblk${devnum}p2 rootwait rw"
 setenv displayargs ""
 setenv mmcargs "setenv bootargs console=${console} ${smp} root=${mmcroot} \
 	${displayargs}"
+setenv miscadj "
+if test '${boardsoc}' = 'imx53'; then
+       setenv bootargs '${bootargs} di=${dig_in} key1=${key1}';
+fi;"
 setenv boot_fitImage "
 	setenv fdt_conf 'conf@${boardsoc}-${boardname}.dtb';
 	setenv itbcfg "\"#\${fdt_conf}\"";
@@ -39,6 +43,7 @@ if test -e ${devtype} ${devnum}:${distro_bootpart} ${kernel_file}; then
 	if load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} \
 	   ${kernel_file}; then
 		run mmcargs;
+		run miscadj;
 		run boot_fitImage;
 	fi;
 fi;"
@@ -52,6 +57,7 @@ setenv download_kernel "tftpboot ${loadaddr} ${kernel_file}"
 setenv boot_tftp_kernel "
 if run download_kernel; then
 	run mmcargs;
+	run miscadj;
 	run boot_fitImage;
 fi"
 
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/6 board: Add support for KEY1 status detection on K+P's HSC|DDC boards

In reply to Lukasz Majewski

This code provides information if the K+P's imx53 boards had KEY1 pressed.

---

 arch/arm/dts/imx53-kp.dts     |  2 ++
 board/k+p/kp_imx53/kp_imx53.c | 14 ++++++++++++++
 2 files changed, 16 insertions(+)
arch/arm/dts/imx53-kp.dts +2 -0
index 6322ef1323..ca98fb59c6 100644
@@ -88,6 +88,8 @@
 				MX53_PAD_EIM_CS0__GPIO2_23 0x1e4
 				/* LCD BACKLIGHT */
 				MX53_PAD_GPIO_1__GPIO1_1 0x1e4
+				/* KEY1 GPIO */
+				MX53_PAD_EIM_RW__GPIO2_26 0x1e4
 			>;
 		};
 
board/k+p/kp_imx53/kp_imx53.c +14 -0
index 6b0db6b8de..7e947fb617 100644
@@ -23,6 +23,7 @@
 #define PHY_nRST IMX_GPIO_NR(7, 6)
 #define BOOSTER_OFF IMX_GPIO_NR(2, 23)
 #define LCD_BACKLIGHT IMX_GPIO_NR(1, 1)
+#define KEY1 IMX_GPIO_NR(2, 26)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -196,6 +197,17 @@ void board_disable_display(void)
 	gpio_direction_output(LCD_BACKLIGHT, 0);
 }
 
+void board_misc_setup(void)
+{
+	gpio_request(KEY1, "KEY1_GPIO");
+	gpio_direction_input(KEY1);
+
+	if (gpio_get_value(KEY1))
+		env_set("key1", "off");
+	else
+		env_set("key1", "on");
+}
+
 int board_late_init(void)
 {
 	int ret = 0;
@@ -215,5 +227,7 @@ int board_late_init(void)
 	show_eeprom();
 	read_board_id();
 
+	board_misc_setup();
+
 	return ret;
 }
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/6 board: Silent out the console on the K+P's imx53 boards

In reply to Lukasz Majewski

Disable console output by default on imx53 based boards from K+P.

---

 include/configs/kp_imx53.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/kp_imx53.h +1 -0
index 530c3557d0..0dc708e480 100644
@@ -46,6 +46,7 @@
 	"fdt_high=0xffffffff\0"		\
 	"scriptaddr=0x74000000\0"	\
 	"kernel_file=fitImage\0"\
+	"silent=1\0"\
 	"rdinit=/sbin/init\0" \
 	"addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
 	"upd_image=st.4k\0" \
Signature · 1 line
2.11.0
#5 lore raw

PATCH 5/6 board: Remove not needed function for the K+P's imx53 board

In reply to Lukasz Majewski

The get_board_rev() is not needed anymore as a generic function for the imx53 SoC has been used instead.

---

 board/k+p/kp_imx53/kp_imx53.c | 12 ------------
 1 file changed, 12 deletions(-)
board/k+p/kp_imx53/kp_imx53.c +0 -12
index 7e947fb617..becb6a63fa 100644
@@ -45,18 +45,6 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-u32 get_board_rev(void)
-{
-	struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
-	struct fuse_bank *bank = &iim->bank[0];
-	struct fuse_bank0_regs *fuse =
-		(struct fuse_bank0_regs *)bank->fuse_regs;
-
-	int rev = readl(&fuse->gp[6]);
-
-	return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
-}
-
 #ifdef CONFIG_USB_EHCI_MX5
 int board_ehci_hcd_init(int port)
 {
Signature · 1 line
2.11.0
#6 lore raw

PATCH 6/6 config: Update defconfig for imx53 K+P boards

In reply to Lukasz Majewski

This commit updates the defconfig for the HSC and DDC boards.

---

 configs/kp_imx53_defconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
configs/kp_imx53_defconfig +5 -1
index 63e017da9a..43fd1a7aff 100644
@@ -6,10 +6,14 @@ CONFIG_TARGET_KP_IMX53=y
 CONFIG_DEFAULT_DEVICE_TREE="imx53-kp"
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx53loco/imximage.cfg"
+CONFIG_SILENT_CONSOLE=y
+# CONFIG_SILENT_CONSOLE_UPDATE_ON_SET is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_HUSH_PARSER=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_STOP_STR="."
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -18,6 +22,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
+CONFIG_CMD_PMIC=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
@@ -26,7 +31,6 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_I2C_DEFAULT_BUS_NUMBER=0x1
 CONFIG_PHYLIB=y
-CONFIG_PHY_ADDR=1
 CONFIG_PHY_SMSC=y
 CONFIG_FEC_MXC=y
 CONFIG_PINCTRL=y
Signature · 1 line
2.11.0