summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-07-02 08:13:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-02 09:17:56 +0200
commit893f30f614da5ed132265f5c4da767ec26a8edf5 (patch)
treebcea2e2aea3b1026c48b2cf6299b63938f52d67d
parent84d28cec7f49b9dabf14892323a6ea421c470fea (diff)
downloadbarebox-893f30f614da5ed132265f5c4da767ec26a8edf5.tar.gz
barebox-893f30f614da5ed132265f5c4da767ec26a8edf5.tar.xz
ARM: beagleboard: Move to multiimage support
Breathe some life back into the beagleboard: - switch to multiimage support - update config - initialize early UART for debugging Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/beagle/Makefile1
-rw-r--r--arch/arm/boards/beagle/board.c13
-rw-r--r--arch/arm/boards/beagle/defaultenv-beagle/boot/mmc (renamed from arch/arm/boards/beagle/env/boot/mmc)0
-rw-r--r--arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi (renamed from arch/arm/boards/beagle/env/boot/nand-ubi)0
-rw-r--r--arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi-dt (renamed from arch/arm/boards/beagle/env/boot/nand-ubi-dt)0
-rw-r--r--arch/arm/boards/beagle/defaultenv-beagle/init/mtdparts-nand (renamed from arch/arm/boards/beagle/env/init/mtdparts-nand)0
-rw-r--r--arch/arm/boards/beagle/defaultenv-beagle/network/eth0-discover (renamed from arch/arm/boards/beagle/env/network/eth0-discover)0
-rw-r--r--arch/arm/boards/beagle/lowlevel.c39
-rw-r--r--arch/arm/configs/omap3530_beagle_defconfig81
-rw-r--r--arch/arm/configs/omap3530_beagle_xload_defconfig17
-rw-r--r--arch/arm/mach-omap/Kconfig14
-rw-r--r--images/Makefile1
-rw-r--r--images/Makefile.omap319
13 files changed, 132 insertions, 53 deletions
diff --git a/arch/arm/boards/beagle/Makefile b/arch/arm/boards/beagle/Makefile
index 01c7a259e9..3bee9a22ab 100644
--- a/arch/arm/boards/beagle/Makefile
+++ b/arch/arm/boards/beagle/Makefile
@@ -1,2 +1,3 @@
obj-y += board.o
lwl-y += lowlevel.o
+bbenv-y += defaultenv-beagle
diff --git a/arch/arm/boards/beagle/board.c b/arch/arm/boards/beagle/board.c
index 775621069c..b7efe95627 100644
--- a/arch/arm/boards/beagle/board.c
+++ b/arch/arm/boards/beagle/board.c
@@ -22,6 +22,7 @@
#include <linux/sizes.h>
#include <io.h>
#include <ns16550.h>
+#include <envfs.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
#include <mach/gpmc.h>
@@ -31,6 +32,7 @@
#include <i2c/i2c.h>
#include <linux/err.h>
#include <usb/ehci.h>
+#include <asm/barebox-arm.h>
#ifdef CONFIG_DRIVER_SERIAL_NS16550
@@ -42,6 +44,9 @@
*/
static int beagle_console_init(void)
{
+ if (barebox_arm_machine() != MACH_TYPE_OMAP3_BEAGLE)
+ return 0;
+
barebox_set_model("Texas Instruments beagle");
barebox_set_hostname("beagle");
@@ -82,6 +87,9 @@ static struct gpmc_nand_platform_data nand_plat = {
static int beagle_mem_init(void)
{
+ if (barebox_arm_machine() != MACH_TYPE_OMAP3_BEAGLE)
+ return 0;
+
omap_add_ram0(SZ_128M);
return 0;
@@ -90,6 +98,9 @@ mem_initcall(beagle_mem_init);
static int beagle_devices_init(void)
{
+ if (barebox_arm_machine() != MACH_TYPE_OMAP3_BEAGLE)
+ return 0;
+
i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
omap3_add_i2c1(NULL);
@@ -107,6 +118,8 @@ static int beagle_devices_init(void)
armlinux_set_architecture(MACH_TYPE_OMAP3_BEAGLE);
+ defaultenv_append_directory(defaultenv_beagle);
+
return 0;
}
device_initcall(beagle_devices_init);
diff --git a/arch/arm/boards/beagle/env/boot/mmc b/arch/arm/boards/beagle/defaultenv-beagle/boot/mmc
index db638f8cf8..db638f8cf8 100644
--- a/arch/arm/boards/beagle/env/boot/mmc
+++ b/arch/arm/boards/beagle/defaultenv-beagle/boot/mmc
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi b/arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi
index e0ef904432..e0ef904432 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi
+++ b/arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi
diff --git a/arch/arm/boards/beagle/env/boot/nand-ubi-dt b/arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi-dt
index 5fc0a6c53a..5fc0a6c53a 100644
--- a/arch/arm/boards/beagle/env/boot/nand-ubi-dt
+++ b/arch/arm/boards/beagle/defaultenv-beagle/boot/nand-ubi-dt
diff --git a/arch/arm/boards/beagle/env/init/mtdparts-nand b/arch/arm/boards/beagle/defaultenv-beagle/init/mtdparts-nand
index 9335bb17a3..9335bb17a3 100644
--- a/arch/arm/boards/beagle/env/init/mtdparts-nand
+++ b/arch/arm/boards/beagle/defaultenv-beagle/init/mtdparts-nand
diff --git a/arch/arm/boards/beagle/env/network/eth0-discover b/arch/arm/boards/beagle/defaultenv-beagle/network/eth0-discover
index 86d13f5c43..86d13f5c43 100644
--- a/arch/arm/boards/beagle/env/network/eth0-discover
+++ b/arch/arm/boards/beagle/defaultenv-beagle/network/eth0-discover
diff --git a/arch/arm/boards/beagle/lowlevel.c b/arch/arm/boards/beagle/lowlevel.c
index d6e6b9f91c..30cc1f2c54 100644
--- a/arch/arm/boards/beagle/lowlevel.c
+++ b/arch/arm/boards/beagle/lowlevel.c
@@ -1,4 +1,5 @@
#include <init.h>
+#include <debug_ll.h>
#include <io.h>
#include <linux/sizes.h>
#include <asm/barebox-arm-head.h>
@@ -11,6 +12,7 @@
#include <mach/sdrc.h>
#include <mach/syslib.h>
#include <mach/sys_info.h>
+#include <generated/mach-types.h>
/**
* @brief Do the pin muxing required for Board operation.
@@ -157,6 +159,22 @@ static void sdrc_init(void)
return;
}
+static noinline int beagle_board_init_sdram(void)
+{
+ struct barebox_arm_boarddata *bd = (void *)OMAP3_SRAM_SCRATCH_SPACE + 0x10;
+
+ boarddata_create(bd, MACH_TYPE_OMAP3_BEAGLE);
+
+ barebox_arm_entry(0x80000000, SZ_128M, bd);
+}
+
+ENTRY_FUNCTION(start_omap3_beagleboard_sdram, bootinfo, r1, r2)
+{
+ omap3_save_bootinfo((void *)bootinfo);
+
+ beagle_board_init_sdram();
+}
+
/**
* @brief The basic entry point for board initialization.
*
@@ -166,28 +184,37 @@ static void sdrc_init(void)
*
* @return void
*/
-static int beagle_board_init(void)
+static noinline int beagle_board_init(void)
{
int in_sdram = omap3_running_in_sdram();
+ struct barebox_arm_boarddata bd;
if (!in_sdram)
omap3_core_init();
mux_config();
+
+ omap_uart_lowlevel_init((void *)OMAP3_UART3_BASE);
+
/* Dont reconfigure SDRAM while running in SDRAM! */
if (!in_sdram)
sdrc_init();
- return 0;
+ boarddata_create(&bd, MACH_TYPE_OMAP3_BEAGLE);
+
+ barebox_arm_entry(0x80000000, SZ_128M, &bd);
}
-void __naked __bare_init barebox_arm_reset_vector(uint32_t *data)
+ENTRY_FUNCTION(start_omap3_beagleboard_sram, bootinfo, r1, r2)
{
- omap3_save_bootinfo(data);
+ omap3_save_bootinfo((void *)bootinfo);
arm_cpu_lowlevel_init();
- beagle_board_init();
+ omap3_gp_romcode_call(OMAP3_GP_ROMCODE_API_L2_INVAL, 0);
+
+ relocate_to_current_adr();
+ setup_c();
- barebox_arm_entry(0x80000000, SZ_128M, NULL);
+ beagle_board_init();
}
diff --git a/arch/arm/configs/omap3530_beagle_defconfig b/arch/arm/configs/omap3530_beagle_defconfig
index 3068fbb94b..070f1566ee 100644
--- a/arch/arm/configs/omap3530_beagle_defconfig
+++ b/arch/arm/configs/omap3530_beagle_defconfig
@@ -1,67 +1,79 @@
CONFIG_ARCH_OMAP=y
+CONFIG_OMAP_MULTI_BOARDS=y
CONFIG_MACH_BEAGLE=y
CONFIG_THUMB2_BAREBOX=y
-CONFIG_CMD_ARM_MMUINFO=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_UNWIND=y
-CONFIG_PBL_IMAGE=y
CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x87e00000
-CONFIG_MALLOC_SIZE=0x2000000
+CONFIG_TEXT_BASE=0x0
+CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_TLSF=y
CONFIG_KALLSYMS=y
+CONFIG_RELOCATABLE=y
CONFIG_PROMPT="barebox> "
-CONFIG_LONGHELP=y
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
+CONFIG_BLSPEC=y
+CONFIG_IMD_TARGET=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/beagle/env"
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_MSLEEP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_DIRNAME=y
-CONFIG_CMD_LN=y
-CONFIG_CMD_READLINK=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_MEMINFO=y
+CONFIG_RESET_SOURCE=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_OMAP_UART_PORT=3
+CONFIG_DEBUG_INITCALLS=y
+CONFIG_CMD_DMESG=y
+CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_CRC_CMP=y
-CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_FLASH=y
+CONFIG_CMD_IMD=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_ARM_MMUINFO=y
CONFIG_CMD_BOOTM_SHOW_TYPE=y
CONFIG_CMD_BOOTM_VERBOSE=y
CONFIG_CMD_BOOTM_INITRD=y
CONFIG_CMD_BOOTM_OFTREE=y
CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
-CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_RESET=y
CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_DEFAULTENV=y
+CONFIG_CMD_PRINTENV=y
CONFIG_CMD_MAGICVAR=y
CONFIG_CMD_MAGICVAR_HELP=y
-CONFIG_CMD_GPIO=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FILETYPE=y
+CONFIG_CMD_LN=y
+CONFIG_CMD_MD5SUM=y
CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_I2C=y
+CONFIG_CMD_MSLEEP=y
+CONFIG_CMD_READF=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_HOST=y
CONFIG_CMD_MIITOOL=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TFTP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_MENUTREE=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_DETECT=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_BAREBOX_UPDATE=y
+CONFIG_CMD_TIME=y
CONFIG_NET=y
-CONFIG_CMD_DHCP=y
CONFIG_NET_NFS=y
-CONFIG_CMD_PING=y
CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
CONFIG_NET_USB=y
@@ -81,6 +93,7 @@ CONFIG_MCI=y
CONFIG_MCI_STARTUP=y
CONFIG_MCI_OMAP_HSMMC=y
CONFIG_MFD_TWL4030=y
+CONFIG_FS_EXT4=y
CONFIG_FS_TFTP=y
CONFIG_FS_NFS=y
CONFIG_FS_FAT=y
diff --git a/arch/arm/configs/omap3530_beagle_xload_defconfig b/arch/arm/configs/omap3530_beagle_xload_defconfig
index 585ee0f1d1..074cc2116b 100644
--- a/arch/arm/configs/omap3530_beagle_xload_defconfig
+++ b/arch/arm/configs/omap3530_beagle_xload_defconfig
@@ -1,21 +1,25 @@
CONFIG_ARCH_OMAP=y
CONFIG_OMAP_BUILD_IFT=y
+CONFIG_OMAP3_USBBOOT=y
+CONFIG_OMAP3_USB_LOADER=y
+CONFIG_OMAP_MULTI_BOARDS=y
CONFIG_MACH_BEAGLE=y
CONFIG_THUMB2_BAREBOX=y
-# CONFIG_CMD_ARM_CPUINFO is not set
-# CONFIG_ARM_EXCEPTIONS is not set
-CONFIG_TEXT_BASE=0x40200000
-CONFIG_MEMORY_LAYOUT_FIXED=y
-CONFIG_STACK_BASE=0x4020F000
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_ARM_UNWIND=y
+CONFIG_MMU=y
+CONFIG_TEXT_BASE=0x0
CONFIG_STACK_SIZE=0xc00
-CONFIG_MALLOC_BASE=0x87BFFF10
+CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_DUMMY=y
+CONFIG_RELOCATABLE=y
CONFIG_PROMPT="X-load Beagle>"
CONFIG_SHELL_NONE=y
# CONFIG_ERRNO_MESSAGES is not set
# CONFIG_TIMESTAMP is not set
CONFIG_CONSOLE_SIMPLE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_OFDEVICE=y
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
# CONFIG_SPI is not set
@@ -33,6 +37,7 @@ CONFIG_MCI=y
CONFIG_MCI_STARTUP=y
# CONFIG_MCI_WRITE is not set
CONFIG_MCI_OMAP_HSMMC=y
+# CONFIG_PINCTRL is not set
# CONFIG_FS_RAMFS is not set
# CONFIG_FS_DEVFS is not set
CONFIG_FS_FAT=y
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index abf204a63d..af359756ba 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -157,6 +157,13 @@ config MACH_AFI_GF
help
Say Y here if you are using afis GF
+config MACH_BEAGLE
+ bool "Texas Instrument's Beagle Board"
+ select HAVE_DEFAULT_ENVIRONMENT_NEW
+ select ARCH_OMAP3
+ help
+ Say Y here if you are using Beagle Board
+
config MACH_BEAGLEBONE
bool "Texas Instrument's Beagle Bone"
select ARCH_AM33XX
@@ -180,13 +187,6 @@ config MACH_OMAP343xSDP
help
Say Y here if you are using SDP343x platform
-config MACH_BEAGLE
- bool "Texas Instrument's Beagle Board"
- select HAVE_DEFAULT_ENVIRONMENT_NEW
- select ARCH_OMAP3
- help
- Say Y here if you are using Beagle Board
-
config MACH_OMAP3EVM
bool "Texas Instrument's OMAP3 EVM"
select ARCH_OMAP3
diff --git a/images/Makefile b/images/Makefile
index 587cb2651f..1e1771f35c 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -105,6 +105,7 @@ include $(srctree)/images/Makefile.imx
include $(srctree)/images/Makefile.imxhabv4
include $(srctree)/images/Makefile.mvebu
include $(srctree)/images/Makefile.mxs
+include $(srctree)/images/Makefile.omap3
include $(srctree)/images/Makefile.rockchip
include $(srctree)/images/Makefile.socfpga
include $(srctree)/images/Makefile.tegra
diff --git a/images/Makefile.omap3 b/images/Makefile.omap3
new file mode 100644
index 0000000000..694ec30836
--- /dev/null
+++ b/images/Makefile.omap3
@@ -0,0 +1,19 @@
+# %.mlo - convert into mlo image
+# ----------------------------------------------------------------
+quiet_cmd_omap3_mlo_image = MLO $@
+ cmd_omap3_mlo_image = scripts/omap_signGP -o $@ -l 0x40200000 -c $<
+
+$(obj)/%.omap3_mlo: $(obj)/% FORCE
+ $(call if_changed,omap3_mlo_image)
+
+pblx-$(CONFIG_MACH_BEAGLE) += start_omap3_beagleboard_sdram start_omap3_beagleboard_sram
+FILE_barebox-beagleboard.img = start_omap3_beagleboard_sdram.pblx
+omap3-barebox-$(CONFIG_MACH_BEAGLE) += barebox-beagleboard.img
+FILE_barebox-beagleboard-mlo.img = start_omap3_beagleboard_sram.pblx.omap3_mlo
+omap3-mlo-$(CONFIG_MACH_BEAGLE) += barebox-beagleboard-mlo.img
+
+ifdef CONFIG_OMAP_BUILD_IFT
+image-y += $(omap3-mlo-y)
+else
+image-y += $(omap3-barebox-y)
+endif