View | Details | Raw Unified | Return to bug 243038
Collapse All | Expand All

(-)sysutils/u-boot-osd-customboard/Makefile (+13 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
MASTERDIR=	${.CURDIR}/../u-boot-master
4
EXTRA_PATCHES=  ${.CURDIR}/files/
5
6
MODEL=		osd-customboard
7
BOARD_CONFIG=	am335x_evm_defconfig
8
FAMILY=		omap
9
10
CONFIG_FRAGMENT=	${.CURDIR}/files/bbb_fragment
11
FRAGMENT_NAME=		bbb_fragment
12
13
.include "${MASTERDIR}/Makefile"
(-)sysutils/u-boot-osd-customboard/files/bbb_fragment (+10 lines)
Line 0 Link Here
1
CONFIG_API=y
2
CONFIG_ARMV7_NONSEC=n
3
CONFIG_CMD_CACHE=y
4
CONFIG_BOOTCOMMAND="run preboot; if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; setenv boot_targets mmc0 mmc1 pxe dhcp; run distro_bootcmd"
5
CONFIG_NAND=n
6
CONFIG_SPL_NAND_SUPPORT=n
7
CONFIG_CMD_NAND=n
8
CONFIG_DFU_NAND=n
9
CONFIG_ENV_IS_IN_MMC=y
10
CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
(-)sysutils/u-boot-osd-customboard/files/patch-arch_arm_dts_Makefile (+11 lines)
Line 0 Link Here
1
--- arch/arm/dts/Makefile.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ arch/arm/dts/Makefile	2019-10-18 17:11:26.536861000 +0200
3
@@ -276,6 +276,8 @@
4
 dtb-$(CONFIG_ARCH_ZYNQMP_R5) += \
5
 	zynqmp-r5.dtb
6
 dtb-$(CONFIG_AM33XX) += \
7
+	am335x-osdbasic.dtb \
8
+	am335x-osdcustomboard.dtb \
9
 	am335x-baltos.dtb \
10
 	am335x-bone.dtb \
11
 	am335x-boneblack.dtb \
(-)sysutils/u-boot-osd-customboard/files/patch-arch_arm_dts_am335x_osdbasic.dts (+123 lines)
Line 0 Link Here
1
--- /dev/null	2019-10-18 18:47:21.382321000 +0200
2
+++ arch/arm/dts/am335x-osdbasic.dts	2019-10-18 17:11:26.544504000 +0200
3
@@ -0,0 +1,120 @@
4
+// SPDX-License-Identifier: GPL-2.0
5
+/*
6
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
7
+ *
8
+ * Author: Robert Nelson <robertcnelson@gmail.com>
9
+ */
10
+/dts-v1/;
11
+
12
+#include "am33xx.dtsi"
13
+#include "am335x-osd335x-common.dtsi"
14
+
15
+/ {
16
+	model = "Octavo Systems OSD335x BASIC";
17
+	compatible = "ti,osd335x", "ti,am33xx";
18
+
19
+	chosen {
20
+		stdout-path = &uart0;
21
+	};
22
+
23
+	vmmcsd_fixed: fixedregulator0 {
24
+		compatible = "regulator-fixed";
25
+		regulator-name = "vmmcsd_fixed";
26
+		regulator-min-microvolt = <3300000>;
27
+		regulator-max-microvolt = <3300000>;
28
+	};
29
+};
30
+
31
+&am33xx_pinmux {
32
+	mmc0_pins: pinmux-mmc0-pins {
33
+		pinctrl-single,pins = <
34
+			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G16) mmc0_dat0.mmc0_dat0 */
35
+			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G15) mmc0_dat1.mmc0_dat1 */
36
+			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)	/* (F18) mmc0_dat2.mmc0_dat2 */
37
+			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)	/* (F17) mmc0_dat3.mmc0_dat3 */
38
+			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G18) mmc0_cmd.mmc0_cmd */
39
+			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G17) mmc0_clk.mmc0_clk */
40
+		>;
41
+	};
42
+
43
+	spi0_pins: pinmux-spi0-pins {
44
+		pinctrl-single,pins = <
45
+			AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0)	/* (A17) spi0_sclk.spi0_sclk */
46
+			AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0)	/* (B17) spi0_d0.spi0_d0 */
47
+			AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)	/* (B16) spi0_d1.spi0_d1 */
48
+			AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0)	/* (A16) spi0_cs0.spi0_cs0 */
49
+		>;
50
+	};
51
+
52
+	spi1_pins: pinmux-spi1-pins {
53
+		pinctrl-single,pins = <
54
+			AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE4)	/* (C18) eCAP0_in_PWM0_out.spi1_sclk */
55
+			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE4)	/* (E18) uart0_ctsn.spi1_d0 */
56
+			AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE4)	/* (E17) uart0_rtsn.spi1_d1 */
57
+			AM33XX_IOPAD(0x9b0, PIN_INPUT_PULLUP | MUX_MODE4)	/* (A15) xdma_event_intr0.spi1_cs1 */
58
+		>;
59
+	};
60
+
61
+	uart0_pins: pinmux-uart0-pins {
62
+		pinctrl-single,pins = <
63
+			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)	/* (E15) uart0_rxd.uart0_rxd */
64
+			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* (E16) uart0_txd.uart0_txd */
65
+		>;
66
+	};
67
+};
68
+
69
+&i2c0 {
70
+	eeprom: eeprom@50 {
71
+		compatible = "atmel,24c256";
72
+		reg = <0x50>;
73
+	};
74
+};
75
+
76
+&mmc1 {
77
+	status = "okay";
78
+	vmmc-supply = <&vmmcsd_fixed>;
79
+	bus-width = <4>;
80
+	pinctrl-names = "default";
81
+	pinctrl-0 = <&mmc0_pins>;
82
+};
83
+
84
+&rtc {
85
+	system-power-controller;
86
+};
87
+
88
+&uart0 {
89
+	pinctrl-names = "default";
90
+	pinctrl-0 = <&uart0_pins>;
91
+
92
+	status = "okay";
93
+};
94
+
95
+&usb {
96
+	status = "okay";
97
+};
98
+
99
+&usb_ctrl_mod {
100
+	status = "okay";
101
+};
102
+
103
+&usb0_phy {
104
+	status = "okay";
105
+};
106
+
107
+&usb0 {
108
+	status = "okay";
109
+	dr_mode = "otg";
110
+};
111
+
112
+&usb1_phy {
113
+	status = "okay";
114
+};
115
+
116
+&usb1 {
117
+	status = "okay";
118
+	dr_mode = "host";
119
+};
120
+
121
+&cppi41dma  {
122
+	status = "okay";
123
+};
(-)sysutils/u-boot-osd-customboard/files/patch-arch_arm_dts_am335x_osdcustomboard.dts (+123 lines)
Line 0 Link Here
1
--- /dev/null   2019-10-22 15:38:54.837660000 +0200
2
+++ arch/arm/dts/am335x-osdcustomboard.dts      2019-10-22 15:38:27.954148000 +0200
3
@@ -0,0 +1,120 @@
4
+// SPDX-License-Identifier: GPL-2.0
5
+/*
6
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
7
+ *
8
+ * Author: Robert Nelson <robertcnelson@gmail.com>
9
+ */
10
+/dts-v1/;
11
+
12
+#include "am33xx.dtsi"
13
+#include "am335x-osd335x-common.dtsi"
14
+
15
+/ {
16
+	model = "Octavo Systems OSD335x Customboard";
17
+	compatible = "ti,osd335x", "ti,am33xx";
18
+
19
+	chosen {
20
+		stdout-path = &uart0;
21
+	};
22
+
23
+	vmmcsd_fixed: fixedregulator0 {
24
+		compatible = "regulator-fixed";
25
+		regulator-name = "vmmcsd_fixed";
26
+		regulator-min-microvolt = <3300000>;
27
+		regulator-max-microvolt = <3300000>;
28
+	};
29
+};
30
+
31
+&am33xx_pinmux {
32
+	mmc0_pins: pinmux-mmc0-pins {
33
+		pinctrl-single,pins = <
34
+			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G16) mmc0_dat0.mmc0_dat0 */
35
+			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G15) mmc0_dat1.mmc0_dat1 */
36
+			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)	/* (F18) mmc0_dat2.mmc0_dat2 */
37
+			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)	/* (F17) mmc0_dat3.mmc0_dat3 */
38
+			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G18) mmc0_cmd.mmc0_cmd */
39
+			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)	/* (G17) mmc0_clk.mmc0_clk */
40
+		>;
41
+	};
42
+
43
+	spi0_pins: pinmux-spi0-pins {
44
+		pinctrl-single,pins = <
45
+			AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0)	/* (A17) spi0_sclk.spi0_sclk */
46
+			AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0)	/* (B17) spi0_d0.spi0_d0 */
47
+			AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)	/* (B16) spi0_d1.spi0_d1 */
48
+			AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0)	/* (A16) spi0_cs0.spi0_cs0 */
49
+		>;
50
+	};
51
+
52
+	spi1_pins: pinmux-spi1-pins {
53
+		pinctrl-single,pins = <
54
+			AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE4)	/* (C18) eCAP0_in_PWM0_out.spi1_sclk */
55
+			AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE4)	/* (E18) uart0_ctsn.spi1_d0 */
56
+			AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE4)	/* (E17) uart0_rtsn.spi1_d1 */
57
+			AM33XX_IOPAD(0x9b0, PIN_INPUT_PULLUP | MUX_MODE4)	/* (A15) xdma_event_intr0.spi1_cs1 */
58
+		>;
59
+	};
60
+
61
+	uart0_pins: pinmux-uart0-pins {
62
+		pinctrl-single,pins = <
63
+			AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)	/* (E15) uart0_rxd.uart0_rxd */
64
+			AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* (E16) uart0_txd.uart0_txd */
65
+		>;
66
+	};
67
+};
68
+
69
+&i2c0 {
70
+	eeprom: eeprom@50 {
71
+		compatible = "atmel,24c256";
72
+		reg = <0x50>;
73
+	};
74
+};
75
+
76
+&mmc1 {
77
+	status = "okay";
78
+	vmmc-supply = <&vmmcsd_fixed>;
79
+	bus-width = <4>;
80
+	pinctrl-names = "default";
81
+	pinctrl-0 = <&mmc0_pins>;
82
+};
83
+
84
+&rtc {
85
+	system-power-controller;
86
+};
87
+
88
+&uart0 {
89
+	pinctrl-names = "default";
90
+	pinctrl-0 = <&uart0_pins>;
91
+
92
+	status = "okay";
93
+};
94
+
95
+&usb {
96
+	status = "okay";
97
+};
98
+
99
+&usb_ctrl_mod {
100
+	status = "okay";
101
+};
102
+
103
+&usb0_phy {
104
+	status = "okay";
105
+};
106
+
107
+&usb0 {
108
+	status = "okay";
109
+	dr_mode = "otg";
110
+};
111
+
112
+&usb1_phy {
113
+	status = "okay";
114
+};
115
+
116
+&usb1 {
117
+	status = "okay";
118
+	dr_mode = "host";
119
+};
120
+
121
+&cppi41dma  {
122
+	status = "okay";
123
+};
(-)sysutils/u-boot-osd-customboard/files/patch-arch_arm_include_asm_arch__am33xx_hardware__am33xx.h (+10 lines)
Line 0 Link Here
1
--- arch/arm/include/asm/arch-am33xx/hardware_am33xx.h.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ arch/arm/include/asm/arch-am33xx/hardware_am33xx.h	2019-10-18 17:11:26.548880000 +0200
3
@@ -60,6 +60,7 @@
4
 
5
 /* RTC base address */
6
 #define RTC_BASE			0x44E3E000
7
+#define RTC_OSC				(RTC_BASE + 0x0054)
8
 
9
 /* OTG */
10
 #define USB0_OTG_BASE			0x47401000
(-)sysutils/u-boot-osd-customboard/files/patch-board_ti_am335x_board.c (+108 lines)
Line 0 Link Here
1
--- board/ti/am335x/board.c.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ board/ti/am335x/board.c	2019-11-27 19:59:29.685514000 +0100
3
@@ -29,6 +29,7 @@
4
 #include <asm/omap_common.h>
5
 #include <asm/omap_sec_common.h>
6
 #include <asm/omap_mmc.h>
7
+#include <asm/davinci_rtc.h>
8
 #include <i2c.h>
9
 #include <miiphy.h>
10
 #include <cpsw.h>
11
@@ -266,7 +267,8 @@
12
 
13
 	if (board_is_evm_sk())
14
 		return &dpll_ddr3_303MHz[ind];
15
-	else if (board_is_pb() || board_is_bone_lt() || board_is_icev2())
16
+	else if (board_is_osd_custom() || board_is_osd_blank() || board_is_pb() ||
17
+	    board_is_bone_lt() || board_is_icev2())
18
 		return &dpll_ddr3_400MHz[ind];
19
 	else if (board_is_evm_15_or_later())
20
 		return &dpll_ddr3_303MHz[ind];
21
@@ -297,7 +299,7 @@
22
 	if (bone_not_connected_to_ac_power())
23
 		freq = MPUPLL_M_600;
24
 
25
-	if (board_is_pb() || board_is_bone_lt())
26
+	if (board_is_osd_custom() || board_is_osd_blank() || board_is_pb() || board_is_bone_lt())
27
 		freq = MPUPLL_M_1000;
28
 
29
 	switch (freq) {
30
@@ -556,7 +558,7 @@
31
 	if (board_is_evm_sk())
32
 		config_ddr(303, &ioregs_evmsk, &ddr3_data,
33
 			   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
34
-	else if (board_is_pb() || board_is_bone_lt())
35
+	else if (board_is_osd_custom() || board_is_osd_blank() || board_is_pb() || board_is_bone_lt())
36
 		config_ddr(400, &ioregs_bonelt,
37
 			   &ddr3_beagleblack_data,
38
 			   &ddr3_beagleblack_cmd_ctrl_data,
39
@@ -629,6 +631,7 @@
40
 /* At the moment, we do not want to stop booting for any failures here */
41
 int ft_board_setup(void *fdt, bd_t *bd)
42
 {
43
+#if 0
44
 	const char *slave_path, *enet_name;
45
 	int enetnode, slavenode, phynode;
46
 	struct udevice *ethdev;
47
@@ -695,6 +698,7 @@
48
 	}
49
 
50
 done:
51
+#endif
52
 	return 0;
53
 }
54
 #endif
55
@@ -704,6 +708,31 @@
56
  */
57
 int board_init(void)
58
 {
59
+	u32 sys_reboot, sys_rtc_osc;
60
+
61
+	sys_reboot = readl(PRM_RSTST);
62
+	if (sys_reboot & (1 << 9))
63
+		puts("Reset Source: IcePick reset has occurred.\n");
64
+
65
+	if (sys_reboot & (1 << 5))
66
+		puts("Reset Source: Global external warm reset has occurred.\n");
67
+
68
+	if (sys_reboot & (1 << 4))
69
+		puts("Reset Source: watchdog reset has occurred.\n");
70
+
71
+	if (sys_reboot & (1 << 1))
72
+		puts("Reset Source: Global warm SW reset has occurred.\n");
73
+
74
+	if (sys_reboot & (1 << 0))
75
+		puts("Reset Source: Power-on reset has occurred.\n");
76
+
77
+	sys_rtc_osc = readl(RTC_OSC);
78
+	if (sys_rtc_osc & (1 << 3)) {
79
+		puts("RTC 32KCLK Source: External.\n");
80
+	} else {
81
+		puts("RTC 32KCLK Source: Internal.\n");
82
+	}
83
+
84
 #if defined(CONFIG_HW_WATCHDOG)
85
 	hw_watchdog_init();
86
 #endif
87
@@ -814,6 +843,10 @@
88
 		}
89
 	}
90
 
91
+	if (board_is_osd_custom())
92
+		name = "OSDC";
93
+	if (board_is_osd_blank())
94
+		name = "OSDBLNK";
95
 	if (board_is_bbg1())
96
 		name = "BBG1";
97
 	if (board_is_bben())
98
@@ -927,7 +960,9 @@
99
 #ifdef CONFIG_SPL_LOAD_FIT
100
 int board_fit_config_name_match(const char *name)
101
 {
102
-	if (board_is_gp_evm() && !strcmp(name, "am335x-evm"))
103
+	if (board_is_osd_custom() && !strcmp(name, "am335x-osdcustomboard"))
104
+		return 0;
105
+	else if (board_is_gp_evm() && !strcmp(name, "am335x-evm"))
106
 		return 0;
107
 	else if (board_is_bone() && !strcmp(name, "am335x-bone"))
108
 		return 0;
(-)sysutils/u-boot-osd-customboard/files/patch-board_ti_am335x_board.h (+29 lines)
Line 0 Link Here
1
--- board/ti/am335x/board.h.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ board/ti/am335x/board.h	2019-10-18 17:11:26.552651000 +0200
3
@@ -23,6 +23,16 @@
4
 #define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK       0x00141414
5
 #define EMIF_OCP_CONFIG_AM335X_EVM             0x003d3d3d
6
 
7
+static inline int board_is_osd_custom(void)
8
+{
9
+	return board_ti_is("OSDC");
10
+}
11
+
12
+static inline int board_is_osd_blank(void)
13
+{
14
+	return board_ti_is("OSDBLNK");
15
+}
16
+
17
 static inline int board_is_bone(void)
18
 {
19
 	return board_ti_is("A335BONE");
20
@@ -50,7 +60,8 @@
21
 
22
 static inline int board_is_beaglebonex(void)
23
 {
24
-	return board_is_pb() || board_is_bone() || board_is_bone_lt() ||
25
+	return board_is_osd_custom() || board_is_osd_blank() ||
26
+	       board_is_pb() || board_is_bone() || board_is_bone_lt() ||
27
 	       board_is_bbg1() || board_is_bben();
28
 }
29
 
(-)sysutils/u-boot-osd-customboard/files/patch-board_ti_am335x_mux.c (+48 lines)
Line 0 Link Here
1
--- board/ti/am335x/mux.c.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ board/ti/am335x/mux.c	2019-10-18 17:11:26.554513000 +0200
3
@@ -65,7 +65,6 @@
4
 	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
5
 	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
6
 	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
7
-	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
8
 	{OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)},	/* GPIO0_6 */
9
 	{-1},
10
 };
11
@@ -77,7 +76,6 @@
12
 	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
13
 	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
14
 	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
15
-	{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},		/* MMC0_WP */
16
 	{-1},
17
 };
18
 
19
@@ -356,7 +354,18 @@
20
 void enable_board_pin_mux(void)
21
 {
22
 	/* Do board-specific muxes. */
23
-	if (board_is_bone()) {
24
+	if (board_is_osd_custom()) {
25
+		configure_module_pin_mux(mii1_pin_mux);
26
+		//configure_module_pin_mux(mmc0_pin_mux);
27
+		configure_module_pin_mux(mmc0_no_cd_pin_mux);
28
+#if 0
29
+#if defined(CONFIG_NAND)
30
+		configure_module_pin_mux(nand_pin_mux);
31
+#else
32
+		configure_module_pin_mux(mmc1_pin_mux);
33
+#endif
34
+#endif
35
+	} else if (board_is_bone()) {
36
 		/* Beaglebone pinmux */
37
 		configure_module_pin_mux(mii1_pin_mux);
38
 		configure_module_pin_mux(mmc0_pin_mux);
39
@@ -422,6 +431,8 @@
40
 		configure_module_pin_mux(spi0_pin_mux);
41
 	} else {
42
 		/* Unknown board. We might still be able to boot. */
43
-		puts("Bad EEPROM or unknown board, cannot configure pinmux.");
44
+		puts("Unknown board: Assuming OSD Custom Board(MMC0 no cd).");
45
+		//configure_module_pin_mux(mmc0_pin_mux);
46
+		configure_module_pin_mux(mmc0_no_cd_pin_mux);
47
 	}
48
 }
(-)sysutils/u-boot-osd-customboard/files/patch-board_ti_common_board__detect.c (+27 lines)
Line 0 Link Here
1
--- board/ti/common/board_detect.c.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ board/ti/common/board_detect.c	2019-10-18 17:11:26.556397000 +0200
3
@@ -215,6 +215,16 @@
4
 
5
 	rc = ti_i2c_eeprom_get(bus_addr, dev_addr, TI_EEPROM_HEADER_MAGIC,
6
 			       sizeof(am_ep), (uint8_t *)&am_ep);
7
+	if (rc < 0) {
8
+		ep->header = TI_EEPROM_HEADER_MAGIC;
9
+		strlcpy(ep->name, "OSDBLNK", TI_EEPROM_HDR_NAME_LEN + 1);
10
+		ti_eeprom_string_cleanup(ep->name);
11
+
12
+		strlcpy(ep->version, "1.0A", TI_EEPROM_HDR_REV_LEN + 1);
13
+		ti_eeprom_string_cleanup(ep->version);
14
+
15
+		goto already_read;
16
+	}
17
 	if (rc)
18
 		return rc;
19
 
20
@@ -237,6 +247,7 @@
21
 	memcpy(ep->mac_addr, am_ep.mac_addr,
22
 	       TI_EEPROM_HDR_NO_OF_MAC_ADDR * TI_EEPROM_HDR_ETH_ALEN);
23
 
24
+already_read:
25
 	return 0;
26
 }
27
 
(-)sysutils/u-boot-osd-customboard/files/patch-configs_am335x_evm_defconfig (+13 lines)
Line 0 Link Here
1
--- configs/am335x_evm_defconfig.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ configs/am335x_evm_defconfig	2019-10-18 17:11:26.558165000 +0200
3
@@ -32,8 +32,8 @@
4
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
5
 # CONFIG_SPL_EFI_PARTITION is not set
6
 CONFIG_OF_CONTROL=y
7
-CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
8
-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
9
+CONFIG_DEFAULT_DEVICE_TREE="am335x-osdbasic"
10
+CONFIG_OF_LIST="am335x-osdbasic am335x-osdcustomboard"
11
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
12
 CONFIG_SPL_ENV_IS_NOWHERE=y
13
 CONFIG_BOOTCOUNT_LIMIT=y
(-)sysutils/u-boot-osd-customboard/files/patch-env_common.c (+18 lines)
Line 0 Link Here
1
--- env/common.c.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ env/common.c	2019-10-18 17:11:26.560114000 +0200
3
@@ -202,6 +202,7 @@
4
 /* Export the environment and generate CRC for it. */
5
 int env_export(env_t *env_out)
6
 {
7
+#if !defined(CONFIG_SPL_BUILD)
8
 	char *res;
9
 	ssize_t	len;
10
 
11
@@ -216,6 +217,7 @@
12
 
13
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
14
 	env_out->flags = ++env_flags; /* increase the serial */
15
+#endif
16
 #endif
17
 
18
 	return 0;
(-)sysutils/u-boot-osd-customboard/files/patch-include_configs_am335x__evm.h (+36 lines)
Line 0 Link Here
1
--- include/configs/am335x_evm.h.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ include/configs/am335x_evm.h	2019-10-18 17:11:26.561908000 +0200
3
@@ -129,10 +129,25 @@
4
 		"sf probe ${spibusno}:0; " \
5
 		"sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
6
 		"bootz ${loadaddr}\0" \
7
+	"preboot=echo board_name=[$board_name] ...; " \
8
+		"if test $board_name = OSDBLNK; then " \
9
+			"echo OSDBLNK ...; " \
10
+			"run eeprom_dump; " \
11
+			"run eeprom_blank; " \
12
+			"run eeprom_osdcustom; " \
13
+			"run eeprom_dump; " \
14
+			"reset; " \
15
+		"fi;\0 " \
16
 	"ramboot=echo Booting from ramdisk ...; " \
17
 		"run ramargs; " \
18
 		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
19
 	"findfdt="\
20
+		"echo board_name=[$board_name] ...; " \
21
+		"if test $board_name = OSDC; then " \
22
+			"setenv fdtfile am335x-osdcustomboard.dtb; fi; " \
23
+		"if test $board_name = OSDBLNK; then " \
24
+			"echo BLANK BOARD!; " \
25
+			"run preboot; fi; " \
26
 		"if test $board_name = A335BONE; then " \
27
 			"setenv fdtfile am335x-bone.dtb; fi; " \
28
 		"if test $board_name = A335BNLT; then " \
29
@@ -163,6 +178,7 @@
30
 		"else " \
31
 			"setenv console ttyO0,115200n8;" \
32
 		"fi;\0" \
33
+	EEPROM_PROGRAMMING \
34
 	NANDARGS \
35
 	NETARGS \
36
 	DFUARGS \
(-)sysutils/u-boot-osd-customboard/files/patch-include_configs_ti__armv7__common.h (+66 lines)
Line 0 Link Here
1
--- include/configs/ti_armv7_common.h.orig	2019-10-07 23:14:02.000000000 +0200
2
+++ include/configs/ti_armv7_common.h	2019-10-18 17:11:26.563758000 +0200
3
@@ -108,6 +108,63 @@
4
 /* Boot Argument Buffer Size */
5
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
6
 
7
+#define EEPROM_PROGRAMMING \
8
+	"eeprom_dump=i2c dev 0; " \
9
+		"i2c md 0x50 0x00.2 20; " \
10
+		"\0" \
11
+	"eeprom_blank=i2c dev 0; " \
12
+		"i2c mw 0x50 0x00.2 ff; " \
13
+		"i2c mw 0x50 0x01.2 ff; " \
14
+		"i2c mw 0x50 0x02.2 ff; " \
15
+		"i2c mw 0x50 0x03.2 ff; " \
16
+		"i2c mw 0x50 0x04.2 ff; " \
17
+		"i2c mw 0x50 0x05.2 ff; " \
18
+		"i2c mw 0x50 0x06.2 ff; " \
19
+		"i2c mw 0x50 0x07.2 ff; " \
20
+		"i2c mw 0x50 0x08.2 ff; " \
21
+		"i2c mw 0x50 0x09.2 ff; " \
22
+		"i2c mw 0x50 0x0a.2 ff; " \
23
+		"i2c mw 0x50 0x0b.2 ff; " \
24
+		"i2c mw 0x50 0x0c.2 ff; " \
25
+		"i2c mw 0x50 0x0d.2 ff; " \
26
+		"i2c mw 0x50 0x0e.2 ff; " \
27
+		"i2c mw 0x50 0x0f.2 ff; " \
28
+		"i2c mw 0x50 0x10.2 ff; " \
29
+		"i2c mw 0x50 0x11.2 ff; " \
30
+		"i2c mw 0x50 0x12.2 ff; " \
31
+		"i2c mw 0x50 0x13.2 ff; " \
32
+		"i2c mw 0x50 0x14.2 ff; " \
33
+		"i2c mw 0x50 0x15.2 ff; " \
34
+		"i2c mw 0x50 0x16.2 ff; " \
35
+		"i2c mw 0x50 0x17.2 ff; " \
36
+		"i2c mw 0x50 0x18.2 ff; " \
37
+		"i2c mw 0x50 0x19.2 ff; " \
38
+		"i2c mw 0x50 0x1a.2 ff; " \
39
+		"i2c mw 0x50 0x1b.2 ff; " \
40
+		"i2c mw 0x50 0x1c.2 ff; " \
41
+		"i2c mw 0x50 0x1d.2 ff; " \
42
+		"i2c mw 0x50 0x1e.2 ff; " \
43
+		"i2c mw 0x50 0x1f.2 ff; " \
44
+		"\0" \
45
+	"eeprom_osdcustom= " \
46
+		"i2c mw 0x50 0x00.2 aa; " \
47
+		"i2c mw 0x50 0x01.2 55; " \
48
+		"i2c mw 0x50 0x02.2 33; " \
49
+		"i2c mw 0x50 0x03.2 ee; " \
50
+		"i2c mw 0x50 0x04.2 4F; " \
51
+		"i2c mw 0x50 0x05.2 53; " \
52
+		"i2c mw 0x50 0x06.2 44; " \
53
+		"i2c mw 0x50 0x07.2 43; " \
54
+		"i2c mw 0x50 0x08.2 ff; " \
55
+		"i2c mw 0x50 0x09.2 ff; " \
56
+		"i2c mw 0x50 0x0a.2 ff; " \
57
+		"i2c mw 0x50 0x0b.2 ff; " \
58
+		"i2c mw 0x50 0x0c.2 30; " \
59
+		"i2c mw 0x50 0x0d.2 30; " \
60
+		"i2c mw 0x50 0x0e.2 41; " \
61
+		"i2c mw 0x50 0x0f.2 32; " \
62
+		"\0"
63
+
64
 /*
65
  * When we have SPI, NOR or NAND flash we expect to be making use of
66
  * mtdparts, both for ease of use in U-Boot and for passing information
(-)sysutils/u-boot-osd-customboard/pkg-descr (+28 lines)
Line 0 Link Here
1
IMPORTANT: If your board is a Beaglebone *any colour*/PocketBeagle
2
           please use sysutils/u-boot-beaglebone
3
4
IMPORTANT: This port are NOT intended to work out of the box on your
5
           custom board. You have to understand your hardware design and 
6
           at least modify the device tree to make it work on your
7
           custom board.
8
9
U-Boot loader for custom board based on OSD3358/AM335x with blank EEPROM.
10
(Based on u-boot-beaglebone)
11
12
This version is patched so that:
13
 * API features are enabled.
14
 * Implementation described here
15
   https://octavosystems.com/app_notes/osd335x-eeprom-during-boot/
16
 * And Robert C Nelson patchset 2019.07
17
   https://github.com/RobertCNelson/Bootloader-Builder/tree/master/patches
18
19
You have to ensure your hardware are compatible with the device tree files 
20
 * files/patch-arch_arm_dts_am335x_osdbasic.dts 
21
 * files/patch-arch_arm_dts_am335x_osdcustomboard.dts
22
Also check the definition of mmc0 pins in
23
 * board/ti/am335x/mux.c (files/patch-board_ti_am335x_mux.c)
24
25
To install this bootloader, copy the files MLO and u-boot.img to the FAT
26
partition on an SD card or the eMMC.
27
28
WWW: http://www.denx.de/wiki/U-Boot

Return to bug 243038