Skip to contentSkip to conversation

arm: baltos: remove TI board leftover

PATCH New yegorslists at googlemail.com 2 participants 6 messages Dec 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 arm: baltos: remove TI board leftover

From: Yegor Yefremov <[email protected]>

Remove unneeded pinmux configurations and TI EEPROM struct.

---
 board/vscom/baltos/board.c |  1 -
 board/vscom/baltos/board.h | 55 ------------------------------------
 board/vscom/baltos/mux.c   | 69 ----------------------------------------------
 3 files changed, 125 deletions(-)
board/vscom/baltos/board.c +0 -1
index 27056e1..dbf79a5 100644
@@ -415,7 +415,6 @@ int board_eth_init(bd_t *bis)
 	int rv, n = 0;
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
-	__maybe_unused struct am335x_baseboard_id header;
 
 	/*
 	 * Note here that we're using CPSW1 since that has a 1Gbit PHY while
board/vscom/baltos/board.h +0 -55

73 lines not on this page · raw message

board/vscom/baltos/mux.c +0 -69

93 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/3 arm: baltos: active mPCIe slot

From: Yegor Yefremov <[email protected]>

Baltos devices provide a mPCIe slot, whose power is turned off by default. This patch activates mPCIe slot in U-Boot, so that for example GSM modem can be already available in user space.

---
 board/vscom/baltos/board.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
board/vscom/baltos/board.c +18 -0
index dbf79a5..d3b1f15 100644
@@ -39,6 +39,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* GPIO that controls power to DDR on EVM-SK */
 #define GPIO_DDR_VTT_EN		7
 #define DIP_S1			44
+#define MPCIE_SW		100
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
@@ -330,6 +331,11 @@ int ft_board_setup(void *blob, bd_t *bd)
 	return 0;
 }
 
+static struct module_pin_mux pcie_sw_pin_mux[] = {
+	{OFFSET(mii1_rxdv), (MODE(7) | PULLUDEN )},     /* GPIO3_4 */
+	{-1},
+};
+
 static struct module_pin_mux dip_pin_mux[] = {
 	{OFFSET(gpmc_ad12), (MODE(7) | RXACTIVE )},	/* GPIO1_12 */
 	{OFFSET(gpmc_ad13), (MODE(7)  | RXACTIVE )},	/* GPIO1_13 */
@@ -355,6 +361,18 @@ int board_late_init(void)
 			baltos_set_console();
 		}
 	}
+
+	/* turn power for the mPCIe slot */
+	configure_module_pin_mux(pcie_sw_pin_mux);
+	if (gpio_request(MPCIE_SW, "mpcie_sw")) {
+		printf("failed to export GPIO %d\n", MPCIE_SW);
+		return -ENODEV;
+	}
+	if (gpio_direction_output(MPCIE_SW, 1)) {
+		printf("failed to set GPIO %d direction\n", MPCIE_SW);
+		return -ENODEV;
+	}
+
 	setenv("board_name", model);
 #endif
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/3 arm: baltos: active mPCIe slot

Quoted 7 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

Baltos devices provide a mPCIe slot, whose power is turned off by default. This patch activates mPCIe slot in U-Boot, so that for example GSM modem can be already available in user space.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161201/2a80f8fb/attachment.sig>
#3 lore raw

PATCH 3/3 arm: baltos: enable booting from USB

In reply to yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

First of all U-Boot would search for a USB mass storage device with either uEnv.txt or kernel-fit.itb and boot.

If USB mass storage device is not available or doesn't provide these files then MMC will be tried.

---
 include/configs/baltos.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
include/configs/baltos.h +33 -0
index 8efd513..06f5ceb 100644
@@ -102,7 +102,9 @@
 	"optargs=\0" \
 	"mmcdev=0\0" \
 	"mmcroot=/dev/mmcblk0p2 ro\0" \
+	"usbroot=/dev/sda2 ro\0" \
 	"mmcrootfstype=ext4 rootwait\0" \
+	"usbrootfstype=ext4 rootwait\0" \
 	"rootpath=/export/rootfs\0" \
 	"nfsopts=nolock\0" \
 	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
@@ -114,6 +116,11 @@
 		"${mtdparts} " \
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
+	"usbargs=setenv bootargs console=${console} " \
+		"${optargs} " \
+		"${mtdparts} " \
+		"root=${usbroot} " \
+		"rootfstype=${usbrootfstype}\0" \
 	"spiroot=/dev/mtdblock4 rw\0" \
 	"spirootfstype=jffs2\0" \
 	"spisrcaddr=0xe0000\0" \
@@ -130,15 +137,25 @@
 		"ip=dhcp\0" \
 	"bootenv=uEnv.txt\0" \
 	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+	"usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t $loadaddr $filesize\0" \
+	"usbimportbootenv=echo Importing environment from USB ...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"ramargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"root=${ramroot} " \
 		"rootfstype=${ramrootfstype}\0" \
 	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
 	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+	"usbloados=run usbargs; " \
+		"bootm ${loadaddr}#conf${board_name}; " \
+		"if test $? -ne 0; then " \
+			"echo Using default FIT configuration; " \
+			"bootm ${loadaddr}; " \
+		"fi;\0" \
 	"mmcloados=run mmcargs; " \
 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
 			"if run loadfdt; then " \
@@ -153,6 +170,21 @@
 		"else " \
 			"bootz; " \
 		"fi;\0" \
+	"usbboot=usb reset; " \
+		"if usb storage; then " \
+			"echo USB drive found;" \
+			"if run usbloadbootenv; then " \
+				"echo Loaded environment from ${bootenv};" \
+				"run usbimportbootenv;" \
+			"fi;" \
+			"if test -n $uenvcmd; then " \
+				"echo Running uenvcmd ...;" \
+				"run uenvcmd;" \
+			"fi;" \
+			"if run usbloadimage; then " \
+				"run usbloados;" \
+			"fi;" \
+		"fi;\0" \
 	"mmcboot=mmc dev ${mmcdev}; " \
 		"if mmc rescan; then " \
 			"echo SD/MMC found on device ${mmcdev};" \
@@ -190,6 +222,7 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"run findfdt; " \
+	"run usbboot;" \
 	"run mmcboot;" \
 	"setenv mmcdev 1; " \
 	"setenv bootpart 1:2; " \
Signature · 1 line
2.1.4
#4 lore raw

PATCH 3/3 arm: baltos: enable booting from USB

Quoted 9 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

First of all U-Boot would search for a USB mass storage device with either uEnv.txt or kernel-fit.itb and boot.

If USB mass storage device is not available or doesn't provide these files then MMC will be tried.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161201/0528930c/attachment.sig>
#5 lore raw

PATCH 1/3 arm: baltos: remove TI board leftover

In reply to yegorslists at googlemail.com
Quoted 5 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

Remove unneeded pinmux configurations and TI EEPROM struct.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161201/54f24252/attachment.sig>