From 5bea125f60d7864d7294313f11f8adacb15490d4 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 18 Oct 2011 21:28:31 +0200 Subject: u-boot 2011.10rc: make uboot pass beaglebone machine ID when encountering a valid bone eeprom ID Signed-off-by: Koen Kooi --- ...ach-types-Add-new-beaglebone-machine-type.patch | 47 ++++++++++++++++++++++ ...lebone-is-detected-pass-the-MACH_TYPE_BEA.patch | 29 +++++++++++++ ...single-byte-address-EEPROM-for-board-iden.patch | 46 +++++++++++++++++++++ ...fall-back-to-bone-if-header.config-is-emp.patch | 40 ++++++++++++++++++ recipes-bsp/u-boot/u-boot_2011.10rc.bb | 6 ++- 5 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/u-boot/u-boot/2011.09git/0001-mach-types-Add-new-beaglebone-machine-type.patch create mode 100644 recipes-bsp/u-boot/u-boot/2011.09git/0002-evm-If-beaglebone-is-detected-pass-the-MACH_TYPE_BEA.patch create mode 100644 recipes-bsp/u-boot/u-boot/2011.09git/0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch create mode 100644 recipes-bsp/u-boot/u-boot/2011.09git/0004-am335x-evm-fall-back-to-bone-if-header.config-is-emp.patch (limited to 'recipes-bsp') diff --git a/recipes-bsp/u-boot/u-boot/2011.09git/0001-mach-types-Add-new-beaglebone-machine-type.patch b/recipes-bsp/u-boot/u-boot/2011.09git/0001-mach-types-Add-new-beaglebone-machine-type.patch new file mode 100644 index 00000000..6f12d6c1 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09git/0001-mach-types-Add-new-beaglebone-machine-type.patch @@ -0,0 +1,47 @@ +From ec41c3f94a9a498d1f7061abd98e41a66c0ab13e Mon Sep 17 00:00:00 2001 +From: Steve Kipisz +Date: Thu, 13 Oct 2011 14:42:35 -0500 +Subject: [PATCH 1/4] mach-types: Add new beaglebone machine type. + +* New machine type is 3808 + +Signed-off-by: Steve Kipisz +Signed-off-by: Koen Kooi +--- + arch/arm/include/asm/mach-types.h | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h +index c6ea523..68ac2ba 100644 +--- a/arch/arm/include/asm/mach-types.h ++++ b/arch/arm/include/asm/mach-types.h +@@ -3314,6 +3314,7 @@ extern unsigned int __machine_arch_type; + #define MACH_TYPE_GOFLEXHOME 3338 + #define MACH_TYPE_TIAM335EVM 3589 + #define MACH_TYPE_TIAM335IAEVM 3684 ++#define MACH_TYPE_BEAGLEBONE 3808 + + #ifdef CONFIG_ARCH_EBSA110 + # ifdef machine_arch_type +@@ -42927,6 +42928,18 @@ extern unsigned int __machine_arch_type; + # define machine_is_tiam335evm() (0) + #endif + ++#ifdef CONFIG_MACH_BEAGLEBONE ++# ifdef machine_arch_type ++# undef machine_arch_type ++# define machine_arch_type __machine_arch_type ++# else ++# define machine_arch_type MACH_TYPE_BEAGLEBONE ++# endif ++# define machine_is_beaglebone() (machine_arch_type == MACH_TYPE_BEAGLEBONE) ++#else ++# define machine_is_beaglebone() (0) ++#endif ++ + /* + * These have not yet been registered + */ +-- +1.6.6.1 + diff --git a/recipes-bsp/u-boot/u-boot/2011.09git/0002-evm-If-beaglebone-is-detected-pass-the-MACH_TYPE_BEA.patch b/recipes-bsp/u-boot/u-boot/2011.09git/0002-evm-If-beaglebone-is-detected-pass-the-MACH_TYPE_BEA.patch new file mode 100644 index 00000000..7b8e52be --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09git/0002-evm-If-beaglebone-is-detected-pass-the-MACH_TYPE_BEA.patch @@ -0,0 +1,29 @@ +From 17c0530b1539fb8813efc11c60dd87fd9a3a074b Mon Sep 17 00:00:00 2001 +From: Steve Kipisz +Date: Thu, 13 Oct 2011 16:31:26 -0500 +Subject: [PATCH 2/4] evm: If beaglebone is detected, pass the MACH_TYPE_BEAGLEBONE to Linux + +Signed-off-by: Steve Kipisz +Signed-off-by: Koen Kooi +--- + board/ti/am335x/evm.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c +index 95e790b..af34bfd 100755 +--- a/board/ti/am335x/evm.c ++++ b/board/ti/am335x/evm.c +@@ -447,7 +447,9 @@ static void detect_daughter_board_profile(void) + int board_evm_init(void) + { + /* mach type passed to kernel */ +- if (board_id == IA_BOARD) ++ if (board_id == BONE_BOARD) ++ gd->bd->bi_arch_number = MACH_TYPE_BEAGLEBONE; ++ else if (board_id == IA_BOARD) + gd->bd->bi_arch_number = MACH_TYPE_TIAM335IAEVM; + else + gd->bd->bi_arch_number = MACH_TYPE_TIAM335EVM; +-- +1.6.6.1 + diff --git a/recipes-bsp/u-boot/u-boot/2011.09git/0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch b/recipes-bsp/u-boot/u-boot/2011.09git/0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch new file mode 100644 index 00000000..d4ea6073 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09git/0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch @@ -0,0 +1,46 @@ +From 52165b34c2fbcfe93f4cfabb616c2feb3ea7344f Mon Sep 17 00:00:00 2001 +From: Jason Kridner +Date: Thu, 13 Oct 2011 23:50:35 -0400 +Subject: [PATCH 3/4] am335x_evm: single-byte address EEPROM for board identifier + +The BeagleBone has an EEPROM that uses a single byte address instead of a +2-byte address used by the EVM versions. This simply adds a quick attempt +at reading the board identifier header with a 1-byte address if the header +signature isn't correct using a 2-byte address. + +This is only build tested. Having a script to program the expected EEPROM +contents would help me reduce my time to test this. + +Signed-off-by: Koen Kooi +--- + board/ti/am335x/evm.c | 14 ++++++++++++-- + 1 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c +index af34bfd..f484a3c 100755 +--- a/board/ti/am335x/evm.c ++++ b/board/ti/am335x/evm.c +@@ -496,8 +496,18 @@ int board_init(void) + } + + if (header.magic != 0xEE3355AA) { +- printf("Incorrect magic number in EEPROM\n"); +- goto err_out; ++ /* read the eeprom using i2c again, but use only a 1 byte address */ ++ if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 1, (uchar *)&header, ++ sizeof(header))) { ++ printf("Could not read the EEPROM; something fundamentally" ++ " wrong on the I2C bus.\n"); ++ goto err_out; ++ } ++ ++ if (header.magic != 0xEE3355AA) { ++ printf("Incorrect magic number in EEPROM\n"); ++ goto err_out; ++ } + } + + detect_daughter_board(); +-- +1.6.6.1 + diff --git a/recipes-bsp/u-boot/u-boot/2011.09git/0004-am335x-evm-fall-back-to-bone-if-header.config-is-emp.patch b/recipes-bsp/u-boot/u-boot/2011.09git/0004-am335x-evm-fall-back-to-bone-if-header.config-is-emp.patch new file mode 100644 index 00000000..db3ae69c --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.09git/0004-am335x-evm-fall-back-to-bone-if-header.config-is-emp.patch @@ -0,0 +1,40 @@ +From 3e3ac90cdd7fade62e898453f529364e4d9c7589 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 18 Oct 2011 19:18:56 +0200 +Subject: [PATCH 4/4] am335x-evm: fall back to bone if header.config is empty + +Signed-off-by: Koen Kooi +--- + board/ti/am335x/evm.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c +index f484a3c..1c3ba2c 100755 +--- a/board/ti/am335x/evm.c ++++ b/board/ti/am335x/evm.c +@@ -495,6 +495,7 @@ int board_init(void) + goto err_out; + } + ++ printf("EEPROM ID:\n magic: %#08x\n name: %8s\n version: %4s\n serial: %12s\n config: %32s\n mac_addr: %s\n", header.magic, header.name, header.version, header.serial, header.config, header.mac_addr); + if (header.magic != 0xEE3355AA) { + /* read the eeprom using i2c again, but use only a 1 byte address */ + if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 1, (uchar *)&header, +@@ -522,11 +523,10 @@ int board_init(void) + board_id = IPP_BOARD; + } else { + printf("Did not find a recognized configuration, " +- "assuming General purpose EVM in Profile 0 with " +- "Daughter board\n"); +- board_id = GP_BOARD; ++ "assuming BeagleBone\n"); ++ board_id = BONE_BOARD; + profile = 1; /* profile 0 is internally considered as 1 */ +- daughter_board_connected = 1; ++ daughter_board_connected = 0; + } + + configure_evm_pin_mux(board_id, profile, daughter_board_connected); +-- +1.6.6.1 + diff --git a/recipes-bsp/u-boot/u-boot_2011.10rc.bb b/recipes-bsp/u-boot/u-boot_2011.10rc.bb index e10c8955..ad104d69 100644 --- a/recipes-bsp/u-boot/u-boot_2011.10rc.bb +++ b/recipes-bsp/u-boot/u-boot_2011.10rc.bb @@ -4,7 +4,7 @@ require u-boot.inc COMPATIBLE_MACHINE = "(ti33x)" DEFAULT_PREFERENCE_ti33x = "99" PV = "2011.09+git" -PR = "r9" +PR = "r10" # SPL build UBOOT_BINARY = "u-boot.img" @@ -15,6 +15,10 @@ SRC_URI = "git://github.com/trini/u-boot.git;protocol=git;branch=int_am335xpsp_0 file://2011.09git/0001-am335x_evm-boot-kernel-from-ext2-3-filesystem.patch \ file://2011.09git/0002-am335x_evm-set-bootdelay-to-0.patch \ file://2011.09git/0003-am335x-evm-make-rootfs-RO-on-boot.patch \ + file://2011.09git/0001-mach-types-Add-new-beaglebone-machine-type.patch \ + file://2011.09git/0002-evm-If-beaglebone-is-detected-pass-the-MACH_TYPE_BEA.patch \ + file://2011.09git/0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch \ + file://2011.09git/0004-am335x-evm-fall-back-to-bone-if-header.config-is-emp.patch \ " SRCREV = "3fb65523c5994718b56a3b4b18ddf1ef3ffc02dc" -- cgit v1.2.3-54-g00ecf