* [PATCH 2/5] ARM: dts: Add a new compatible type for am335x phytec SOMs
2015-02-04 14:00 [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Wadim Egorov
@ 2015-02-04 14:00 ` Wadim Egorov
2015-02-04 14:00 ` [PATCH 3/5] boards: Add phytec-som-am335x Wadim Egorov
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Wadim Egorov @ 2015-02-04 14:00 UTC (permalink / raw)
To: barebox
Added a new compatible type for am335x phytec SOMs
"phytec,am335x-som"
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
arch/arm/dts/am335x-phytec-phycore-som-mlo.dts | 2 +-
arch/arm/dts/am335x-phytec-phycore-som.dts | 2 +-
arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts | 2 +-
arch/arm/dts/am335x-phytec-phyflex-som.dts | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts b/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts
index d8fceff..b08a59e 100644
--- a/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts
+++ b/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts
@@ -12,7 +12,7 @@
/ {
model = "Phytec phyCORE AM335x";
- compatible = "phytec,phycore-am335x-som", "ti,am33xx";
+ compatible = "phytec,phycore-am335x-som", "phytec,am335x-som", "ti,am33xx";
};
/* Keep all bootsources disabled, we enable and register them
diff --git a/arch/arm/dts/am335x-phytec-phycore-som.dts b/arch/arm/dts/am335x-phytec-phycore-som.dts
index 93f09e2..f13e0d6 100644
--- a/arch/arm/dts/am335x-phytec-phycore-som.dts
+++ b/arch/arm/dts/am335x-phytec-phycore-som.dts
@@ -12,7 +12,7 @@
/ {
model = "Phytec phyCORE AM335x";
- compatible = "phytec,phycore-am335x-som", "ti,am33xx";
+ compatible = "phytec,phycore-am335x-som", "phytec,am335x-som", "ti,am33xx";
};
&spi0 {
diff --git a/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts b/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts
index ab9a9ec..5294ff5 100644
--- a/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts
+++ b/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts
@@ -12,7 +12,7 @@
/ {
model = "Phytec phyFLEX AM335x";
- compatible = "phytec,phyflex-am335x-som", "ti,am33xx";
+ compatible = "phytec,phyflex-am335x-som", "phytec,am335x-som", "ti,am33xx";
};
/* Keep all bootsources disabled, we enable and register them
diff --git a/arch/arm/dts/am335x-phytec-phyflex-som.dts b/arch/arm/dts/am335x-phytec-phyflex-som.dts
index 2239f07..2be83b6 100644
--- a/arch/arm/dts/am335x-phytec-phyflex-som.dts
+++ b/arch/arm/dts/am335x-phytec-phyflex-som.dts
@@ -12,7 +12,7 @@
/ {
model = "Phytec phyFLEX AM335x";
- compatible = "phytec,phyflex-am335x-som", "ti,am33xx";
+ compatible = "phytec,phyflex-am335x-som", "phytec,am335x-som", "ti,am33xx";
};
&spi0 {
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/5] boards: Add phytec-som-am335x
2015-02-04 14:00 [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Wadim Egorov
2015-02-04 14:00 ` [PATCH 2/5] ARM: dts: Add a new compatible type for am335x phytec SOMs Wadim Egorov
@ 2015-02-04 14:00 ` Wadim Egorov
2015-02-04 14:00 ` [PATCH 4/5] Docs: Add phytec-som-am335x documentation Wadim Egorov
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Wadim Egorov @ 2015-02-04 14:00 UTC (permalink / raw)
To: barebox
The main idea behind this patch is to avoid redundant board code.
Because of the module similarities of all am335x based phytec boards, we can
merge its code.
The phytec-som-am335x merges the code of all am335x based phytec SOMs.
So we will have only one "board" in the barebox for phyCORE, phyFLEX.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
arch/arm/boards/Makefile | 1 +
arch/arm/boards/phytec-som-am335x/Makefile | 3 +
arch/arm/boards/phytec-som-am335x/board.c | 104 ++++++++++++++
.../defaultenv-physom-am335x/boot/mmc | 8 ++
.../defaultenv-physom-am335x/boot/nand | 8 ++
.../defaultenv-physom-am335x/boot/spi | 9 ++
.../defaultenv-physom-am335x/init/bootsource | 15 ++
.../defaultenv-physom-am335x/nv/bootargs.base | 1 +
arch/arm/boards/phytec-som-am335x/lowlevel.c | 133 ++++++++++++++++++
arch/arm/boards/phytec-som-am335x/ram-timings.h | 154 +++++++++++++++++++++
arch/arm/configs/am335x_defconfig | 1 +
arch/arm/configs/am335x_mlo_defconfig | 1 +
arch/arm/dts/Makefile | 1 +
arch/arm/mach-omap/Kconfig | 6 +
images/Makefile.am33xx | 36 +++++
15 files changed, 481 insertions(+)
create mode 100644 arch/arm/boards/phytec-som-am335x/Makefile
create mode 100644 arch/arm/boards/phytec-som-am335x/board.c
create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc
create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand
create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi
create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource
create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
create mode 100644 arch/arm/boards/phytec-som-am335x/lowlevel.c
create mode 100644 arch/arm/boards/phytec-som-am335x/ram-timings.h
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 9961ca8..88de2b6 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -80,6 +80,7 @@ obj-$(CONFIG_MACH_PCM043) += phytec-phycore-imx35/
obj-$(CONFIG_MACH_PCM049) += phytec-phycore-omap4460/
obj-$(CONFIG_MACH_PCM051) += phytec-phycore-am335x/
obj-$(CONFIG_MACH_PFLA03) += phytec-phyflex-am335x/
+obj-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += phytec-som-am335x/
obj-$(CONFIG_MACH_PHYTEC_PFLA02) += phytec-phyflex-imx6/
obj-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += plathome-openblocks-ax3/
obj-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += plathome-openblocks-a6/
diff --git a/arch/arm/boards/phytec-som-am335x/Makefile b/arch/arm/boards/phytec-som-am335x/Makefile
new file mode 100644
index 0000000..78397bd
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/Makefile
@@ -0,0 +1,3 @@
+lwl-y += lowlevel.o
+obj-y += board.o
+bbenv-y += defaultenv-physom-am335x
diff --git a/arch/arm/boards/phytec-som-am335x/board.c b/arch/arm/boards/phytec-som-am335x/board.c
new file mode 100644
index 0000000..d084898
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/board.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2015 Wadim Egorov, PHYTEC Messtechnik GmbH
+ *
+ * Device initialization for the following modules and board variants:
+ * - phyCORE: PCM-953, phyBOARD-MAIA, phyBOARD-WEGA
+ * - phyFLEX: PBA-B-01
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <bootsource.h>
+#include <common.h>
+#include <nand.h>
+#include <init.h>
+#include <io.h>
+#include <linux/sizes.h>
+#include <envfs.h>
+#include <asm/armlinux.h>
+#include <generated/mach-types.h>
+#include <linux/phy.h>
+#include <linux/micrel_phy.h>
+#include <mach/am33xx-generic.h>
+#include <mach/am33xx-silicon.h>
+#include <mach/bbu.h>
+
+static int physom_coredevice_init(void)
+{
+ if (!of_machine_is_compatible("phytec,am335x-som"))
+ return 0;
+
+ am33xx_register_ethaddr(0, 0);
+
+ return 0;
+}
+coredevice_initcall(physom_coredevice_init);
+
+static struct omap_barebox_part physom_barebox_part = {
+ .nand_offset = SZ_512K,
+ .nand_size = SZ_512K,
+ .nor_offset = SZ_128K,
+ .nor_size = SZ_512K,
+};
+
+static char *xloadslots[] = {
+ "/dev/nand0.xload.bb",
+ "/dev/nand0.xload_backup1.bb",
+ "/dev/nand0.xload_backup2.bb",
+ "/dev/nand0.xload_backup3.bb"
+};
+
+static int physom_devices_init(void)
+{
+ if (!of_machine_is_compatible("phytec,am335x-som"))
+ return 0;
+
+ switch (bootsource_get()) {
+ case BOOTSOURCE_SPI:
+ of_device_enable_path("/chosen/environment-spi");
+ break;
+ case BOOTSOURCE_MMC:
+ omap_set_bootmmc_devname("mmc0");
+ break;
+ default:
+ of_device_enable_path("/chosen/environment-nand");
+ break;
+ }
+
+ omap_set_barebox_part(&physom_barebox_part);
+ defaultenv_append_directory(defaultenv_physom_am335x);
+
+ /* Special module set up */
+ if (of_machine_is_compatible("phytec,phycore-am335x-som")) {
+ armlinux_set_architecture(MACH_TYPE_PCM051);
+ barebox_set_hostname("pcm051");
+ }
+
+ if (of_machine_is_compatible("phytec,phyflex-am335x-som")) {
+ armlinux_set_architecture(MACH_TYPE_PFLA03);
+ am33xx_select_rmii2_crs_dv();
+ barebox_set_hostname("pfla03");
+ }
+
+ /* Register update handler */
+ am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
+ am33xx_bbu_spi_nor_register_handler("spi", "/dev/m25p0.barebox");
+ am33xx_bbu_nand_xloadslots_register_handler("MLO.nand",
+ xloadslots, ARRAY_SIZE(xloadslots));
+ am33xx_bbu_nand_register_handler("nand", "/dev/nand0.barebox.bb");
+
+ if (IS_ENABLED(CONFIG_SHELL_NONE))
+ return am33xx_of_register_bootdevice();
+
+ return 0;
+}
+device_initcall(physom_devices_init);
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc
new file mode 100644
index 0000000..1a642f9
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+global.bootm.image=/boot/linuximage
+global.bootm.oftree=/boot/oftree
+
+bootargs-ip
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait"
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand
new file mode 100644
index 0000000..c6e49be
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+global.bootm.image="/dev/nand0.kernel.bb"
+global.bootm.oftree="/dev/nand0.oftree.bb"
+
+bootargs-ip
+
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi
new file mode 100644
index 0000000..a9c0fe8
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+global.bootm.image="/dev/m25p0.kernel"
+global.bootm.oftree="/dev/m25p0.oftree"
+
+bootargs-ip
+
+# Use rootfs from NAND
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource
new file mode 100644
index 0000000..3f2ff4b
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ -n "$nv.boot.default" ]; then
+ exit
+fi
+
+if [ $bootsource = mmc ]; then
+ global.boot.default="mmc nand spi net"
+elif [ $bootsource = nand ]; then
+ global.boot.default="nand spi mmc net"
+elif [ $bootsource = spi ]; then
+ global.boot.default="spi nand mmc net"
+elif [ $bootsource = net ]; then
+ global.boot.default="net nand spi mmc"
+fi
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
new file mode 100644
index 0000000..d7b01a1
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
@@ -0,0 +1 @@
+console=ttyO0,115200
diff --git a/arch/arm/boards/phytec-som-am335x/lowlevel.c b/arch/arm/boards/phytec-som-am335x/lowlevel.c
new file mode 100644
index 0000000..87ad1f3
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/lowlevel.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2015 Wadim Egorov, PHYTEC Messtechnik GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <linux/sizes.h>
+#include <io.h>
+#include <init.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/am33xx-silicon.h>
+#include <mach/am33xx-clock.h>
+#include <mach/generic.h>
+#include <mach/sdrc.h>
+#include <mach/sys_info.h>
+#include <mach/syslib.h>
+#include <mach/am33xx-mux.h>
+#include <mach/am33xx-generic.h>
+#include <mach/wdt.h>
+#include <debug_ll.h>
+
+#include "ram-timings.h"
+
+#define CLK_M_OSC_MHZ 25
+#define DDR_IOCTRL 0x18B
+
+static const struct am33xx_cmd_control physom_cmd = {
+ .slave_ratio0 = 0x80,
+ .dll_lock_diff0 = 0x0,
+ .invert_clkout0 = 0x0,
+ .slave_ratio1 = 0x80,
+ .dll_lock_diff1 = 0x0,
+ .invert_clkout1 = 0x0,
+ .slave_ratio2 = 0x80,
+ .dll_lock_diff2 = 0x0,
+ .invert_clkout2 = 0x0,
+};
+
+/**
+ * @brief The basic entry point for board initialization.
+ *
+ * This is called as part of machine init (after arch init).
+ * This is again called with stack in SRAM, so not too many
+ * constructs possible here.
+ *
+ * @return void
+ */
+static noinline void physom_board_init(int sdram, void *fdt)
+{
+ struct am335x_sdram_timings *timing = &physom_timings[sdram];
+
+ /*
+ * WDT1 is already running when the bootloader gets control
+ * Disable it to avoid "random" resets
+ */
+ writel(WDT_DISABLE_CODE1, AM33XX_WDT_REG(WSPR));
+ while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
+
+
+ writel(WDT_DISABLE_CODE2, AM33XX_WDT_REG(WSPR));
+ while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
+
+ am33xx_pll_init(MPUPLL_M_600, CLK_M_OSC_MHZ, DDRPLL_M_400);
+
+ am335x_sdram_init(DDR_IOCTRL, &physom_cmd,
+ &timing->regs,
+ &timing->data);
+
+ am33xx_uart_soft_reset((void *)AM33XX_UART0_BASE);
+ am33xx_enable_uart0_pin_mux();
+ omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE);
+ putc_ll('>');
+
+ am335x_barebox_entry(fdt);
+}
+
+static noinline void physom_board_entry(unsigned long bootinfo, int sdram, void *fdt)
+{
+ am33xx_save_bootinfo((void *)bootinfo);
+
+ arm_cpu_lowlevel_init();
+
+ /*
+ * Setup C environment, the board init code uses global variables.
+ * Stackpointer has already been initialized by the ROM code.
+ */
+ relocate_to_current_adr();
+ setup_c();
+
+ physom_board_init(sdram, fdt);
+}
+
+#define PHYTEC_ENTRY_MLO(name, fdt_name, sdram) \
+ ENTRY_FUNCTION(name, bootinfo, r1, r2) \
+ { \
+ extern char __dtb_##fdt_name##_start[]; \
+ void *fdt =__dtb_##fdt_name##_start - \
+ get_runtime_offset(); \
+ physom_board_entry(bootinfo, sdram, fdt); \
+ }
+
+#define PHYTEC_ENTRY(name, fdt_name) \
+ ENTRY_FUNCTION(name, r0, r1, r2) \
+ { \
+ extern char __dtb_##fdt_name##_start[]; \
+ void *fdt =__dtb_##fdt_name##_start - \
+ get_runtime_offset(); \
+ am335x_barebox_entry(fdt); \
+ }
+
+/* phycore-som */
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_128mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J64M1615IT_128MB);
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_256mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J128M16125IT_256MB);
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_512mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J256M16HA15EIT_512MB);
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_2x512mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J512M8125IT_2x512MB);
+PHYTEC_ENTRY(start_am33xx_phytec_phycore_sdram, am335x_phytec_phycore_som);
+PHYTEC_ENTRY(start_am33xx_phytec_phycore_no_spi_sdram, am335x_phytec_phycore_som_no_spi);
+
+/* phyflex-som */
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phyflex_sram_256mb, am335x_phytec_phyflex_som_mlo, PHYFLEX_MT41K128M16JT_256MB);
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phyflex_sram_512mb, am335x_phytec_phyflex_som_mlo, PHYFLEX_MT41K256M16HA_512MB);
+PHYTEC_ENTRY(start_am33xx_phytec_phyflex_sdram, am335x_phytec_phyflex_som);
diff --git a/arch/arm/boards/phytec-som-am335x/ram-timings.h b/arch/arm/boards/phytec-som-am335x/ram-timings.h
new file mode 100644
index 0000000..6d1993e
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/ram-timings.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2015 Wadim Egorov, PHYTEC Messtechnik GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __RAM_TIMINGS_H
+#define __RAM_TIMINGS_H
+
+struct am335x_sdram_timings {
+ struct am33xx_emif_regs regs;
+ struct am33xx_ddr_data data;
+};
+
+enum {
+ PHYFLEX_MT41K128M16JT_256MB,
+ PHYFLEX_MT41K256M16HA_512MB,
+
+ PHYCORE_MT41J128M16125IT_256MB,
+ PHYCORE_MT41J64M1615IT_128MB,
+ PHYCORE_MT41J256M16HA15EIT_512MB,
+ PHYCORE_MT41J512M8125IT_2x512MB,
+};
+
+struct am335x_sdram_timings physom_timings[] = {
+ /* 256 MB */
+ [PHYFLEX_MT41K128M16JT_256MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAD4DB,
+ .emif_tim2 = 0x26437FDA,
+ .emif_tim3 = 0x501F83FF,
+ .sdram_config = 0x61C052B2,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30,
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x34,
+ .wr_dqs_slave_ratio0 = 0x47,
+ .fifo_we_slave_ratio0 = 0x9a,
+ .wr_slave_ratio0 = 0x7e,
+ .use_rank0_delay = 0x0,
+ .dll_lock_diff0 = 0x0,
+ },
+ },
+
+ /* 512 MB */
+ [PHYFLEX_MT41K256M16HA_512MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAE4DB,
+ .emif_tim2 = 0x266B7FDA,
+ .emif_tim3 = 0x501F867F,
+ .sdram_config = 0x61C05332,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30,
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x36,
+ .wr_dqs_slave_ratio0 = 0x47,
+ .fifo_we_slave_ratio0 = 0x95,
+ .wr_slave_ratio0 = 0x7f,
+ .use_rank0_delay = 0x0,
+ .dll_lock_diff0 = 0x0,
+ },
+ },
+
+ /* 256MB */
+ [PHYCORE_MT41J128M16125IT_256MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAD4DB,
+ .emif_tim2 = 0x26437FDA,
+ .emif_tim3 = 0x501F83FF,
+ .sdram_config = 0x61C052B2,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30,
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x3B,
+ .wr_dqs_slave_ratio0 = 0x33,
+ .fifo_we_slave_ratio0 = 0x9c,
+ .wr_slave_ratio0 = 0x6f,
+ },
+ },
+
+ /* 128MB */
+ [PHYCORE_MT41J64M1615IT_128MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAE4DB,
+ .emif_tim2 = 0x262F7FDA,
+ .emif_tim3 = 0x501F82BF,
+ .sdram_config = 0x61C05232,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30,
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x38,
+ .wr_dqs_slave_ratio0 = 0x34,
+ .fifo_we_slave_ratio0 = 0xA2,
+ .wr_slave_ratio0 = 0x72,
+ },
+ },
+
+ /* 512MB */
+ [PHYCORE_MT41J256M16HA15EIT_512MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAE4DB,
+ .emif_tim2 = 0x266B7FDA,
+ .emif_tim3 = 0x501F867F,
+ .sdram_config = 0x61C05332,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x35,
+ .wr_dqs_slave_ratio0 = 0x43,
+ .fifo_we_slave_ratio0 = 0x97,
+ .wr_slave_ratio0 = 0x7b,
+ },
+ },
+
+ /* 1024MB */
+ [PHYCORE_MT41J512M8125IT_2x512MB] = {
+ .regs = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAE4DB,
+ .emif_tim2 = 0x266B7FDA,
+ .emif_tim3 = 0x501F867F,
+ .sdram_config = 0x61C053B2,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30
+ },
+ .data = {
+ .rd_slave_ratio0 = 0x32,
+ .wr_dqs_slave_ratio0 = 0x48,
+ .fifo_we_slave_ratio0 = 0x99,
+ .wr_slave_ratio0 = 0x80,
+ },
+ },
+};
+
+#endif
diff --git a/arch/arm/configs/am335x_defconfig b/arch/arm/configs/am335x_defconfig
index e9bc1ba..5387548 100644
--- a/arch/arm/configs/am335x_defconfig
+++ b/arch/arm/configs/am335x_defconfig
@@ -6,6 +6,7 @@ CONFIG_MACH_AFI_GF=y
CONFIG_MACH_BEAGLEBONE=y
CONFIG_MACH_PCM051=y
CONFIG_MACH_PFLA03=y
+CONFIG_MACH_PHYTEC_SOM_AM335X=y
CONFIG_THUMB2_BAREBOX=y
CONFIG_ARM_BOARD_APPEND_ATAG=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig
index 9734da6..c06519c 100644
--- a/arch/arm/configs/am335x_mlo_defconfig
+++ b/arch/arm/configs/am335x_mlo_defconfig
@@ -6,6 +6,7 @@ CONFIG_MACH_AFI_GF=y
CONFIG_MACH_BEAGLEBONE=y
CONFIG_MACH_PCM051=y
CONFIG_MACH_PFLA03=y
+CONFIG_MACH_PHYTEC_SOM_AM335X=y
CONFIG_THUMB2_BAREBOX=y
# CONFIG_MEMINFO is not set
CONFIG_MMU=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index e87e612..a228b2d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -30,6 +30,7 @@ pbl-dtb-$(CONFIG_MACH_PCAAXL3) += imx6q-phytec-pbaa03.dtb.o
pbl-dtb-$(CONFIG_MACH_PCM038) += imx27-phytec-phycore-rdk.dtb.o
pbl-dtb-$(CONFIG_MACH_PCM051) += am335x-phytec-phycore-som.dtb.o am335x-phytec-phycore-som-no-spi.dtb.o am335x-phytec-phycore-som-mlo.dtb.o
pbl-dtb-$(CONFIG_MACH_PFLA03) += am335x-phytec-phyflex-som.dtb.o am335x-phytec-phyflex-som-mlo.dtb.o
+pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += am335x-phytec-phyflex-som.dtb.o am335x-phytec-phyflex-som-mlo.dtb.o am335x-phytec-phycore-som.dtb.o am335x-phytec-phycore-som-no-spi.dtb.o am335x-phytec-phycore-som-mlo.dtb.o
pbl-dtb-$(CONFIG_MACH_PHYTEC_PFLA02) += imx6s-phytec-pbab01.dtb.o imx6dl-phytec-pbab01.dtb.o imx6q-phytec-pbab01.dtb.o imx6q-phytec-phyboard-alcor.dtb.o imx6dl-phytec-phyboard-subra.dtb.o
pbl-dtb-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += armada-xp-openblocks-ax3-4-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += kirkwood-openblocks_a6-bb.dtb.o
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 7aa37eb..32efe5c 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -158,6 +158,12 @@ config MACH_PFLA03
select ARCH_AM33XX
help
Say Y here if you are using Phytecs phyFLEX pfla03 board
+
+config MACH_PHYTEC_SOM_AM335X
+ bool "Phytec AM335X SOMs"
+ select ARCH_AM33XX
+ help
+ Say Y here if you are using a am335x based Phytecs SOM
endif
choice
diff --git a/images/Makefile.am33xx b/images/Makefile.am33xx
index 002c103..75dfb9a 100644
--- a/images/Makefile.am33xx
+++ b/images/Makefile.am33xx
@@ -51,6 +51,42 @@ pblx-$(CONFIG_MACH_PFLA03) += start_am33xx_phytec_phyflex_sram_512mb
FILE_barebox-am33xx-phytec-phyflex-mlo-512mb.img = start_am33xx_phytec_phyflex_sram_512mb.pblx.mlo
am33xx-mlo-$(CONFIG_MACH_PFLA03) += barebox-am33xx-phytec-phyflex-mlo-512mb.img
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sdram
+FILE_barebox-am33xx-phytec-phycore.img = start_am33xx_phytec_phycore_sdram.pblx
+am33xx-barebox-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_no_spi_sdram
+FILE_barebox-am33xx-phytec-phycore-no-spi.img = start_am33xx_phytec_phycore_no_spi_sdram.pblx
+am33xx-barebox-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore-no-spi.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sram_256mb
+FILE_barebox-am33xx-phytec-phycore-mlo-256mb.img = start_am33xx_phytec_phycore_sram_256mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore-mlo-256mb.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sram_128mb
+FILE_barebox-am33xx-phytec-phycore-mlo-128mb.img = start_am33xx_phytec_phycore_sram_128mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore-mlo-128mb.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sram_512mb
+FILE_barebox-am33xx-phytec-phycore-mlo-512mb.img = start_am33xx_phytec_phycore_sram_512mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore-mlo-512mb.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sram_2x512mb
+FILE_barebox-am33xx-phytec-phycore-mlo-2x512mb.img = start_am33xx_phytec_phycore_sram_2x512mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore-mlo-2x512mb.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phyflex_sdram
+FILE_barebox-am33xx-phytec-phyflex.img = start_am33xx_phytec_phyflex_sdram.pblx
+am33xx-barebox-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phyflex.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phyflex_sram_256mb
+FILE_barebox-am33xx-phytec-phyflex-mlo-256mb.img = start_am33xx_phytec_phyflex_sram_256mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phyflex-mlo-256mb.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phyflex_sram_512mb
+FILE_barebox-am33xx-phytec-phyflex-mlo-512mb.img = start_am33xx_phytec_phyflex_sram_512mb.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phyflex-mlo-512mb.img
+
pblx-$(CONFIG_MACH_BEAGLEBONE) += start_am33xx_beaglebone_sdram
FILE_barebox-am33xx-beaglebone.img = start_am33xx_beaglebone_sdram.pblx
am33xx-barebox-$(CONFIG_MACH_BEAGLEBONE) += barebox-am33xx-beaglebone.img
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/5] Docs: Add phytec-som-am335x documentation
2015-02-04 14:00 [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Wadim Egorov
2015-02-04 14:00 ` [PATCH 2/5] ARM: dts: Add a new compatible type for am335x phytec SOMs Wadim Egorov
2015-02-04 14:00 ` [PATCH 3/5] boards: Add phytec-som-am335x Wadim Egorov
@ 2015-02-04 14:00 ` Wadim Egorov
2015-02-04 14:00 ` [PATCH 5/5] boards: Drop phytec-phycore-am335x, phytec-phyflex-am335x Wadim Egorov
2015-02-06 7:23 ` [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Wadim Egorov @ 2015-02-04 14:00 UTC (permalink / raw)
To: barebox
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
Documentation/boards/am335x.rst | 22 ++++++++++++++++++---
Documentation/boards/am335x/phytec-som.rst | 31 ++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 3 deletions(-)
create mode 100644 Documentation/boards/am335x/phytec-som.rst
diff --git a/Documentation/boards/am335x.rst b/Documentation/boards/am335x.rst
index 7959b84..671c3aa 100644
--- a/Documentation/boards/am335x.rst
+++ b/Documentation/boards/am335x.rst
@@ -13,14 +13,20 @@ for the MLO and ``am335x_defconfig`` for the regular barebox image. The
resulting images will be placed under ``images/``:
::
+
barebox-am33xx-afi-gf.img
barebox-am33xx-afi-gf-mlo.img
barebox-am33xx-beaglebone.img
barebox-am33xx-beaglebone-mlo.img
+ barebox-am33xx-phytec-phycore-mlo-256mb.img
+ barebox-am33xx-phytec-phycore-mlo-128mb.img
+ barebox-am33xx-phytec-phycore-mlo-512mb.img
+ barebox-am33xx-phytec-phycore-mlo-2x512mb.img
+ barebox-am33xx-phytec-phyflex-mlo-256mb.img
+ barebox-am33xx-phytec-phyflex-mlo-512mb.img
barebox-am33xx-phytec-phycore.img
- barebox-am33xx-phytec-phycore-mlo-1x128m16.img
- barebox-am33xx-phytec-phycore-mlo-1x256m16.img
- barebox-am33xx-phytec-phycore-mlo-1x512m16.img
+ barebox-am33xx-phytec-phycore-no-spi.img
+ barebox-am33xx-phytec-phyflex.img
Some boards come in different variants, make sure to pick the correct one.
@@ -40,3 +46,13 @@ SD/MMC
To start barebox from SD/MMC prepare a card with a FAT filesystem. Copy the MLO
file for your board to the card and name it ``MLO``. Copy the regular image
for your board to the card and name it ``barebox.bin``.
+
+AM335x Boards
+------
+
+.. toctree::
+ :glob:
+ :numbered:
+ :maxdepth: 1
+
+ am335x/*
diff --git a/Documentation/boards/am335x/phytec-som.rst b/Documentation/boards/am335x/phytec-som.rst
new file mode 100644
index 0000000..b415f7c
--- /dev/null
+++ b/Documentation/boards/am335x/phytec-som.rst
@@ -0,0 +1,31 @@
+Phytec AM335x based SOMs
+========================
+
+The phycore-som-am335x is actually not a real board. It represents a set of
+am335x based Phytec module families and its boards in the barebox.
+You can find out more about the Phytec SOM concept on the website:
+
+ http://phytec.com/products/system-on-modules/
+
+
+Supported modules and boards
+----------------------------
+
+Currently, barebox supports the following SOMs and boards:
+
+ - phyCORE
+
+ - PCM-953
+ - phyBOARD-MAIA
+ - phyBOARD-WEGA
+
+ - phyFLEX
+
+ - PBA-B-01
+
+
+Building phycore-som-am335x
+---------------------------
+
+The phycore-som-am335x boards are covered by the ``am335x_mlo_defconfig``
+for the MLO and ``am335x_defconfig`` for the regular barebox image.
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/5] boards: Drop phytec-phycore-am335x, phytec-phyflex-am335x
2015-02-04 14:00 [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Wadim Egorov
` (2 preceding siblings ...)
2015-02-04 14:00 ` [PATCH 4/5] Docs: Add phytec-som-am335x documentation Wadim Egorov
@ 2015-02-04 14:00 ` Wadim Egorov
2015-02-06 7:23 ` [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Wadim Egorov @ 2015-02-04 14:00 UTC (permalink / raw)
To: barebox
Both boards are now merged in the phycore-som-am335x board.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
arch/arm/boards/Makefile | 2 -
arch/arm/boards/phytec-phycore-am335x/Makefile | 3 -
arch/arm/boards/phytec-phycore-am335x/board.c | 91 ---------
.../defaultenv-phycore-am335x/boot/mmc | 8 -
.../defaultenv-phycore-am335x/boot/nand | 8 -
.../defaultenv-phycore-am335x/boot/spi | 8 -
.../defaultenv-phycore-am335x/init/bootsource | 15 --
.../defaultenv-phycore-am335x/init/init-usbserial | 4 -
.../defaultenv-phycore-am335x/nv/bootargs.base | 1 -
.../defaultenv-phycore-am335x/nv/hostname | 1 -
arch/arm/boards/phytec-phycore-am335x/lowlevel.c | 215 ---------------------
arch/arm/boards/phytec-phyflex-am335x/Makefile | 3 -
arch/arm/boards/phytec-phyflex-am335x/board.c | 96 ---------
.../defaultenv-phyflex-am335x/boot/mmc | 8 -
.../defaultenv-phyflex-am335x/boot/nand | 8 -
.../defaultenv-phyflex-am335x/boot/spi | 8 -
.../defaultenv-phyflex-am335x/init/bootsource | 15 --
.../defaultenv-phyflex-am335x/nv/hostname | 1 -
.../nv/linux.bootargs.base | 1 -
arch/arm/boards/phytec-phyflex-am335x/lowlevel.c | 181 -----------------
arch/arm/configs/am335x_defconfig | 2 -
arch/arm/configs/am335x_mlo_defconfig | 2 -
arch/arm/mach-omap/Kconfig | 12 --
images/Makefile.am33xx | 36 ----
24 files changed, 729 deletions(-)
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/Makefile
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/board.c
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/bootsource
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/init-usbserial
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/bootargs.base
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/hostname
delete mode 100644 arch/arm/boards/phytec-phycore-am335x/lowlevel.c
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/Makefile
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/board.c
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/mmc
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/nand
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/spi
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/init/bootsource
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/hostname
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/linux.bootargs.base
delete mode 100644 arch/arm/boards/phytec-phyflex-am335x/lowlevel.c
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 88de2b6..4662f53 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -78,8 +78,6 @@ obj-$(CONFIG_MACH_PCM037) += phytec-phycore-imx31/
obj-$(CONFIG_MACH_PCM038) += phytec-phycore-imx27/
obj-$(CONFIG_MACH_PCM043) += phytec-phycore-imx35/
obj-$(CONFIG_MACH_PCM049) += phytec-phycore-omap4460/
-obj-$(CONFIG_MACH_PCM051) += phytec-phycore-am335x/
-obj-$(CONFIG_MACH_PFLA03) += phytec-phyflex-am335x/
obj-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += phytec-som-am335x/
obj-$(CONFIG_MACH_PHYTEC_PFLA02) += phytec-phyflex-imx6/
obj-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += plathome-openblocks-ax3/
diff --git a/arch/arm/boards/phytec-phycore-am335x/Makefile b/arch/arm/boards/phytec-phycore-am335x/Makefile
deleted file mode 100644
index 173a6b6..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-lwl-y += lowlevel.o
-obj-y += board.o
-bbenv-y += defaultenv-phycore-am335x
diff --git a/arch/arm/boards/phytec-phycore-am335x/board.c b/arch/arm/boards/phytec-phycore-am335x/board.c
deleted file mode 100644
index 61a11cf..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/board.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * pcm051 - phyCORE-AM335x Board Initalization Code
- *
- * Copyright (C) 2012 Teresa Gámez, Phytec Messtechnik GmbH
- *
- * Based on arch/arm/boards/omap/board-beagle.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <bootsource.h>
-#include <common.h>
-#include <nand.h>
-#include <init.h>
-#include <io.h>
-#include <linux/sizes.h>
-#include <envfs.h>
-#include <asm/armlinux.h>
-#include <generated/mach-types.h>
-#include <linux/phy.h>
-#include <mach/am33xx-generic.h>
-#include <mach/am33xx-silicon.h>
-#include <mach/bbu.h>
-
-
-static int pcm051_coredevice_init(void)
-{
- if (!of_machine_is_compatible("phytec,phycore-am335x-som"))
- return 0;
-
- am33xx_register_ethaddr(0, 0);
- return 0;
-}
-coredevice_initcall(pcm051_coredevice_init);
-
-static struct omap_barebox_part pcm051_barebox_part = {
- .nand_offset = SZ_512K,
- .nand_size = SZ_512K,
- .nor_offset = SZ_128K,
- .nor_size = SZ_512K,
-};
-
-static char *xloadslots[] = {
- "/dev/nand0.xload.bb",
- "/dev/nand0.xload_backup1.bb",
- "/dev/nand0.xload_backup2.bb",
- "/dev/nand0.xload_backup3.bb"
-};
-
-static int pcm051_devices_init(void)
-{
- if (!of_machine_is_compatible("phytec,phycore-am335x-som"))
- return 0;
-
- switch (bootsource_get()) {
- case BOOTSOURCE_SPI:
- of_device_enable_path("/chosen/environment-spi");
- break;
- case BOOTSOURCE_MMC:
- omap_set_bootmmc_devname("mmc0");
- break;
- default:
- of_device_enable_path("/chosen/environment-nand");
- break;
- }
-
- omap_set_barebox_part(&pcm051_barebox_part);
- armlinux_set_architecture(MACH_TYPE_PCM051);
- defaultenv_append_directory(defaultenv_phycore_am335x);
-
- am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
- am33xx_bbu_spi_nor_register_handler("spi", "/dev/m25p0.barebox");
- am33xx_bbu_nand_xloadslots_register_handler("MLO.nand",
- xloadslots, ARRAY_SIZE(xloadslots));
- am33xx_bbu_nand_register_handler("nand", "/dev/nand0.barebox.bb");
-
- if (IS_ENABLED(CONFIG_SHELL_NONE))
- return am33xx_of_register_bootdevice();
-
- return 0;
-}
-device_initcall(pcm051_devices_init);
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
deleted file mode 100644
index 6a60761..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/mmc
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image=/boot/linuximage
-#global.bootm.oftree=/boot/oftree
-
-bootargs-ip
-
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait"
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
deleted file mode 100644
index 1dfbef9..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/nand
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/dev/nand0.kernel.bb"
-#global.bootm.oftree="/env/oftree"
-
-bootargs-ip
-
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
deleted file mode 100644
index 2f858bd..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/boot/spi
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/dev/m25p0.kernel"
-
-bootargs-ip
-
-# Use rootfs from NAND
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/bootsource b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/bootsource
deleted file mode 100644
index 3f2ff4b..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/bootsource
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if [ -n "$nv.boot.default" ]; then
- exit
-fi
-
-if [ $bootsource = mmc ]; then
- global.boot.default="mmc nand spi net"
-elif [ $bootsource = nand ]; then
- global.boot.default="nand spi mmc net"
-elif [ $bootsource = spi ]; then
- global.boot.default="spi nand mmc net"
-elif [ $bootsource = net ]; then
- global.boot.default="net nand spi mmc"
-fi
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/init-usbserial b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/init-usbserial
deleted file mode 100644
index a154fd1..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/init/init-usbserial
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-#otg1.mode=peripheral
-usbgadget -a -A /dev/nand0.kernel.bb(kernel)
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/bootargs.base b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/bootargs.base
deleted file mode 100644
index d7b01a1..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyO0,115200
diff --git a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/hostname b/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/hostname
deleted file mode 100644
index 988ab6d..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/defaultenv-phycore-am335x/nv/hostname
+++ /dev/null
@@ -1 +0,0 @@
-pcm051
diff --git a/arch/arm/boards/phytec-phycore-am335x/lowlevel.c b/arch/arm/boards/phytec-phycore-am335x/lowlevel.c
deleted file mode 100644
index 843929e..0000000
--- a/arch/arm/boards/phytec-phycore-am335x/lowlevel.c
+++ /dev/null
@@ -1,215 +0,0 @@
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <init.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/am33xx-silicon.h>
-#include <mach/am33xx-clock.h>
-#include <mach/generic.h>
-#include <mach/sdrc.h>
-#include <mach/sys_info.h>
-#include <mach/syslib.h>
-#include <mach/am33xx-mux.h>
-#include <mach/am33xx-generic.h>
-#include <mach/wdt.h>
-#include <debug_ll.h>
-
-static const struct am33xx_cmd_control pcm051_cmd = {
- .slave_ratio0 = 0x80,
- .dll_lock_diff0 = 0x0,
- .invert_clkout0 = 0x0,
- .slave_ratio1 = 0x80,
- .dll_lock_diff1 = 0x0,
- .invert_clkout1 = 0x0,
- .slave_ratio2 = 0x80,
- .dll_lock_diff2 = 0x0,
- .invert_clkout2 = 0x0,
-};
-
-struct pcm051_sdram_timings {
- struct am33xx_emif_regs regs;
- struct am33xx_ddr_data data;
-};
-
-enum {
- MT41J128M16125IT_256MB,
- MT41J64M1615IT_128MB,
- MT41J256M16HA15EIT_512MB,
- MT41J512M8125IT_2x512MB,
-};
-
-struct pcm051_sdram_timings timings[] = {
- /* 256MB */
- [MT41J128M16125IT_256MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAD4DB,
- .emif_tim2 = 0x26437FDA,
- .emif_tim3 = 0x501F83FF,
- .sdram_config = 0x61C052B2,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30,
- },
- .data = {
- .rd_slave_ratio0 = 0x3B,
- .wr_dqs_slave_ratio0 = 0x33,
- .fifo_we_slave_ratio0 = 0x9c,
- .wr_slave_ratio0 = 0x6f,
- },
- },
-
- /* 128MB */
- [MT41J64M1615IT_128MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAE4DB,
- .emif_tim2 = 0x262F7FDA,
- .emif_tim3 = 0x501F82BF,
- .sdram_config = 0x61C05232,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30,
- },
- .data = {
- .rd_slave_ratio0 = 0x38,
- .wr_dqs_slave_ratio0 = 0x34,
- .fifo_we_slave_ratio0 = 0xA2,
- .wr_slave_ratio0 = 0x72,
- },
- },
-
- /* 512MB */
- [MT41J256M16HA15EIT_512MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAE4DB,
- .emif_tim2 = 0x266B7FDA,
- .emif_tim3 = 0x501F867F,
- .sdram_config = 0x61C05332,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30
- },
- .data = {
- .rd_slave_ratio0 = 0x35,
- .wr_dqs_slave_ratio0 = 0x43,
- .fifo_we_slave_ratio0 = 0x97,
- .wr_slave_ratio0 = 0x7b,
- },
- },
-
- /* 1024MB */
- [MT41J512M8125IT_2x512MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAE4DB,
- .emif_tim2 = 0x266B7FDA,
- .emif_tim3 = 0x501F867F,
- .sdram_config = 0x61C053B2,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30
- },
- .data = {
- .rd_slave_ratio0 = 0x32,
- .wr_dqs_slave_ratio0 = 0x48,
- .fifo_we_slave_ratio0 = 0x99,
- .wr_slave_ratio0 = 0x80,
- },
- },
-};
-
-extern char __dtb_am335x_phytec_phycore_som_start[];
-extern char __dtb_am335x_phytec_phycore_som_mlo_start[];
-extern char __dtb_am335x_phytec_phycore_som_no_spi_start[];
-
-/**
- * @brief The basic entry point for board initialization.
- *
- * This is called as part of machine init (after arch init).
- * This is again called with stack in SRAM, so not too many
- * constructs possible here.
- *
- * @return void
- */
-static noinline void pcm051_board_init(int sdram)
-{
- void *fdt;
- struct pcm051_sdram_timings *timing = &timings[sdram];
-
- /* WDT1 is already running when the bootloader gets control
- * Disable it to avoid "random" resets
- */
- writel(WDT_DISABLE_CODE1, AM33XX_WDT_REG(WSPR));
- while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
-
- writel(WDT_DISABLE_CODE2, AM33XX_WDT_REG(WSPR));
- while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
-
- am33xx_pll_init(MPUPLL_M_600, 25, DDRPLL_M_400);
-
- am335x_sdram_init(0x18B, &pcm051_cmd,
- &timing->regs,
- &timing->data);
-
- am33xx_uart_soft_reset((void *)AM33XX_UART0_BASE);
- am33xx_enable_uart0_pin_mux();
- omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE);
- putc_ll('>');
-
- fdt = __dtb_am335x_phytec_phycore_som_mlo_start - get_runtime_offset();
-
- am335x_barebox_entry(fdt);
-}
-
-static noinline void pcm051_board_entry(unsigned long bootinfo, int sdram)
-{
- am33xx_save_bootinfo((void *)bootinfo);
-
- arm_cpu_lowlevel_init();
-
- /*
- * Setup C environment, the board init code uses global variables.
- * Stackpointer has already been initialized by the ROM code.
- */
- relocate_to_current_adr();
- setup_c();
-
- pcm051_board_init(sdram);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_sram_256mb, bootinfo, r1, r2)
-{
- pcm051_board_entry(bootinfo, MT41J128M16125IT_256MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_sram_128mb, bootinfo, r1, r2)
-{
- pcm051_board_entry(bootinfo, MT41J64M1615IT_128MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_sram_512mb, bootinfo, r1, r2)
-{
- pcm051_board_entry(bootinfo, MT41J256M16HA15EIT_512MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_sram_2x512mb, bootinfo, r1, r2)
-{
- pcm051_board_entry(bootinfo, MT41J512M8125IT_2x512MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_sdram, r0, r1, r2)
-{
- void *fdt;
-
- fdt = __dtb_am335x_phytec_phycore_som_start - get_runtime_offset();
-
- am335x_barebox_entry(fdt);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phycore_no_spi_sdram, r0, r1, r2)
-{
- void *fdt;
-
- fdt = __dtb_am335x_phytec_phycore_som_no_spi_start - get_runtime_offset();
-
- am335x_barebox_entry(fdt);
-}
diff --git a/arch/arm/boards/phytec-phyflex-am335x/Makefile b/arch/arm/boards/phytec-phyflex-am335x/Makefile
deleted file mode 100644
index 54734b5..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-lwl-y += lowlevel.o
-obj-y += board.o
-bbenv-y += defaultenv-phyflex-am335x
diff --git a/arch/arm/boards/phytec-phyflex-am335x/board.c b/arch/arm/boards/phytec-phyflex-am335x/board.c
deleted file mode 100644
index aed5c31..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/board.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * pfla03 - phyFLEX-AM335x Board Initalization Code
- *
- * Copyright (C) 2014 Stefan Müller-Klieser, Phytec Messtechnik GmbH
- *
- * Based on arch/arm/boards/omap/board-beagle.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <bootsource.h>
-#include <common.h>
-#include <nand.h>
-#include <init.h>
-#include <io.h>
-#include <linux/sizes.h>
-#include <envfs.h>
-#include <asm/armlinux.h>
-#include <generated/mach-types.h>
-#include <linux/phy.h>
-#include <linux/micrel_phy.h>
-#include <mach/am33xx-generic.h>
-#include <mach/am33xx-silicon.h>
-#include <mach/bbu.h>
-
-static int pfla03_coredevice_init(void)
-{
- if (!of_machine_is_compatible("phytec,phyflex-am335x-som"))
- return 0;
-
- am33xx_register_ethaddr(0, 0);
- am33xx_register_ethaddr(1, 1);
-
- return 0;
-}
-coredevice_initcall(pfla03_coredevice_init);
-
-static struct omap_barebox_part pfla03_barebox_part = {
- .nand_offset = SZ_512K,
- .nand_size = SZ_512K,
- .nor_offset = SZ_128K,
- .nor_size = SZ_512K,
-};
-
-static char *xloadslots[] = {
- "/dev/nand0.xload.bb",
- "/dev/nand0.xload_backup1.bb",
- "/dev/nand0.xload_backup2.bb",
- "/dev/nand0.xload_backup3.bb"
-};
-
-static int pfla03_devices_init(void)
-{
- if (!of_machine_is_compatible("phytec,phyflex-am335x-som"))
- return 0;
-
- switch (bootsource_get()) {
- case BOOTSOURCE_SPI:
- of_device_enable_path("/chosen/environment-spi");
- break;
- case BOOTSOURCE_MMC:
- omap_set_bootmmc_devname("mmc0");
- break;
- default:
- of_device_enable_path("/chosen/environment-nand");
- break;
- }
-
- omap_set_barebox_part(&pfla03_barebox_part);
- armlinux_set_architecture(MACH_TYPE_PFLA03);
- defaultenv_append_directory(defaultenv_phyflex_am335x);
-
- am33xx_select_rmii2_crs_dv();
-
- am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
- am33xx_bbu_spi_nor_register_handler("spi", "/dev/m25p0.barebox");
- am33xx_bbu_nand_xloadslots_register_handler("MLO.nand",
- xloadslots, ARRAY_SIZE(xloadslots));
- am33xx_bbu_nand_register_handler("nand", "/dev/nand0.barebox.bb");
-
- if (IS_ENABLED(CONFIG_SHELL_NONE))
- return am33xx_of_register_bootdevice();
-
-
- return 0;
-}
-device_initcall(pfla03_devices_init);
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/mmc b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/mmc
deleted file mode 100644
index 6a60761..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/mmc
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image=/boot/linuximage
-#global.bootm.oftree=/boot/oftree
-
-bootargs-ip
-
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait"
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/nand b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/nand
deleted file mode 100644
index 1dfbef9..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/nand
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/dev/nand0.kernel.bb"
-#global.bootm.oftree="/env/oftree"
-
-bootargs-ip
-
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/spi b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/spi
deleted file mode 100644
index 2f858bd..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/boot/spi
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/dev/m25p0.kernel"
-
-bootargs-ip
-
-# Use rootfs from NAND
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rw rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/init/bootsource b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/init/bootsource
deleted file mode 100644
index 3f2ff4b..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/init/bootsource
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if [ -n "$nv.boot.default" ]; then
- exit
-fi
-
-if [ $bootsource = mmc ]; then
- global.boot.default="mmc nand spi net"
-elif [ $bootsource = nand ]; then
- global.boot.default="nand spi mmc net"
-elif [ $bootsource = spi ]; then
- global.boot.default="spi nand mmc net"
-elif [ $bootsource = net ]; then
- global.boot.default="net nand spi mmc"
-fi
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/hostname b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/hostname
deleted file mode 100644
index 09c5821..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/hostname
+++ /dev/null
@@ -1 +0,0 @@
-pfla03
diff --git a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/linux.bootargs.base b/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/linux.bootargs.base
deleted file mode 100644
index d7b01a1..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/defaultenv-phyflex-am335x/nv/linux.bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyO0,115200
diff --git a/arch/arm/boards/phytec-phyflex-am335x/lowlevel.c b/arch/arm/boards/phytec-phyflex-am335x/lowlevel.c
deleted file mode 100644
index f6029cd..0000000
--- a/arch/arm/boards/phytec-phyflex-am335x/lowlevel.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * pfla03 - phyFLEX-AM335x lowlevel code
- *
- * Copyright (C) 2014 Stefan Müller-Klieser, Phytec Messtechnik GmbH
- *
- * Based on arch/arm/boards/omap/board-beagle.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <init.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/am33xx-silicon.h>
-#include <mach/am33xx-clock.h>
-#include <mach/generic.h>
-#include <mach/sdrc.h>
-#include <mach/sys_info.h>
-#include <mach/syslib.h>
-#include <mach/am33xx-mux.h>
-#include <mach/am33xx-generic.h>
-#include <mach/wdt.h>
-#include <debug_ll.h>
-
-#define CLK_M_OSC_MHZ 25
-#define DDR_IOCTRL 0x18B
-
-static const struct am33xx_cmd_control pfla03_cmd = {
- .slave_ratio0 = 0x80,
- .dll_lock_diff0 = 0x0,
- .invert_clkout0 = 0x0,
- .slave_ratio1 = 0x80,
- .dll_lock_diff1 = 0x0,
- .invert_clkout1 = 0x0,
- .slave_ratio2 = 0x80,
- .dll_lock_diff2 = 0x0,
- .invert_clkout2 = 0x0,
-};
-
-struct pfla03_sdram_timings {
- struct am33xx_emif_regs regs;
- struct am33xx_ddr_data data;
-};
-
-enum {
- MT41K128M16JT_256MB,
- MT41K256M16HA_512MB,
-};
-
-struct pfla03_sdram_timings pfla03_timings[] = {
- /* 256 MB */
- [MT41K128M16JT_256MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAD4DB,
- .emif_tim2 = 0x26437FDA,
- .emif_tim3 = 0x501F83FF,
- .sdram_config = 0x61C052B2,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30,
- },
- .data = {
- .rd_slave_ratio0 = 0x34,
- .wr_dqs_slave_ratio0 = 0x47,
- .fifo_we_slave_ratio0 = 0x9a,
- .wr_slave_ratio0 = 0x7e,
- .use_rank0_delay = 0x0,
- .dll_lock_diff0 = 0x0,
- },
- },
- /* 512 MB */
- [MT41K256M16HA_512MB] = {
- .regs = {
- .emif_read_latency = 0x7,
- .emif_tim1 = 0x0AAAE4DB,
- .emif_tim2 = 0x266B7FDA,
- .emif_tim3 = 0x501F867F,
- .sdram_config = 0x61C05332,
- .zq_config = 0x50074BE4,
- .sdram_ref_ctrl = 0x00000C30,
- },
- .data = {
- .rd_slave_ratio0 = 0x36,
- .wr_dqs_slave_ratio0 = 0x47,
- .fifo_we_slave_ratio0 = 0x95,
- .wr_slave_ratio0 = 0x7f,
- .use_rank0_delay = 0x0,
- .dll_lock_diff0 = 0x0,
- },
- },
-};
-
-extern char __dtb_am335x_phytec_phyflex_som_start[];
-extern char __dtb_am335x_phytec_phyflex_som_mlo_start[];
-
-/**
- * @brief The basic entry point for board initialization.
- *
- * This is called as part of machine init (after arch init).
- * This is again called with stack in SRAM, so not too many
- * constructs possible here.
- *
- * @return void
- */
-static noinline void pfla03_board_init(int sdram)
-{
- void *fdt;
- struct pfla03_sdram_timings *timing = &pfla03_timings[sdram];
-
- /*
- * WDT1 is already running when the bootloader gets control
- * Disable it to avoid "random" resets
- */
- writel(WDT_DISABLE_CODE1, AM33XX_WDT_REG(WSPR));
- while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
-
- writel(WDT_DISABLE_CODE2, AM33XX_WDT_REG(WSPR));
- while (readl(AM33XX_WDT_REG(WWPS)) != 0x0);
-
- am33xx_pll_init(MPUPLL_M_600, CLK_M_OSC_MHZ, DDRPLL_M_400);
-
- am335x_sdram_init(DDR_IOCTRL, &pfla03_cmd,
- &timing->regs,
- &timing->data);
-
- am33xx_uart_soft_reset((void *)AM33XX_UART0_BASE);
- am33xx_enable_uart0_pin_mux();
- omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE);
- putc_ll('>');
-
- fdt = __dtb_am335x_phytec_phyflex_som_mlo_start - get_runtime_offset();
-
- am335x_barebox_entry(fdt);
-}
-
-static noinline void pfla03_board_entry(unsigned long bootinfo, int sdram)
-{
- am33xx_save_bootinfo((void *)bootinfo);
-
- arm_cpu_lowlevel_init();
-
- /*
- * Setup C environment, the board init code uses global variables.
- * Stackpointer has already been initialized by the ROM code.
- */
- relocate_to_current_adr();
- setup_c();
-
- pfla03_board_init(sdram);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phyflex_sram_256mb, bootinfo, r1, r2)
-{
- pfla03_board_entry(bootinfo, MT41K128M16JT_256MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phyflex_sram_512mb, bootinfo, r1, r2)
-{
- pfla03_board_entry(bootinfo, MT41K256M16HA_512MB);
-}
-
-ENTRY_FUNCTION(start_am33xx_phytec_phyflex_sdram, r0, r1, r2)
-{
- void *fdt;
-
- fdt = __dtb_am335x_phytec_phyflex_som_start - get_runtime_offset();
-
- am335x_barebox_entry(fdt);
-}
diff --git a/arch/arm/configs/am335x_defconfig b/arch/arm/configs/am335x_defconfig
index 5387548..f34a4c6 100644
--- a/arch/arm/configs/am335x_defconfig
+++ b/arch/arm/configs/am335x_defconfig
@@ -4,8 +4,6 @@ CONFIG_BAREBOX_UPDATE_AM33XX_NAND=y
CONFIG_OMAP_MULTI_BOARDS=y
CONFIG_MACH_AFI_GF=y
CONFIG_MACH_BEAGLEBONE=y
-CONFIG_MACH_PCM051=y
-CONFIG_MACH_PFLA03=y
CONFIG_MACH_PHYTEC_SOM_AM335X=y
CONFIG_THUMB2_BAREBOX=y
CONFIG_ARM_BOARD_APPEND_ATAG=y
diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig
index c06519c..1dd7567 100644
--- a/arch/arm/configs/am335x_mlo_defconfig
+++ b/arch/arm/configs/am335x_mlo_defconfig
@@ -4,8 +4,6 @@ CONFIG_OMAP_SERIALBOOT=y
CONFIG_OMAP_MULTI_BOARDS=y
CONFIG_MACH_AFI_GF=y
CONFIG_MACH_BEAGLEBONE=y
-CONFIG_MACH_PCM051=y
-CONFIG_MACH_PFLA03=y
CONFIG_MACH_PHYTEC_SOM_AM335X=y
CONFIG_THUMB2_BAREBOX=y
# CONFIG_MEMINFO is not set
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 32efe5c..444ddf8 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -147,18 +147,6 @@ config MACH_BEAGLEBONE
help
Say Y here if you are using Beagle Bone
-config MACH_PCM051
- bool "Phytec phyCORE pcm051"
- select ARCH_AM33XX
- help
- Say Y here if you are using Phytecs phyCORE pcm051 board
-
-config MACH_PFLA03
- bool "Phytec phyFLEX am335x pfla03"
- select ARCH_AM33XX
- help
- Say Y here if you are using Phytecs phyFLEX pfla03 board
-
config MACH_PHYTEC_SOM_AM335X
bool "Phytec AM335X SOMs"
select ARCH_AM33XX
diff --git a/images/Makefile.am33xx b/images/Makefile.am33xx
index 75dfb9a..00e0092 100644
--- a/images/Makefile.am33xx
+++ b/images/Makefile.am33xx
@@ -15,42 +15,6 @@ pblx-$(CONFIG_MACH_AFI_GF) += start_am33xx_afi_gf_sram
FILE_barebox-am33xx-afi-gf-mlo.img = start_am33xx_afi_gf_sram.pblx.mlo
am33xx-mlo-$(CONFIG_MACH_AFI_GF) += barebox-am33xx-afi-gf-mlo.img
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_sdram
-FILE_barebox-am33xx-phytec-phycore.img = start_am33xx_phytec_phycore_sdram.pblx
-am33xx-barebox-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore.img
-
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_no_spi_sdram
-FILE_barebox-am33xx-phytec-phycore-no-spi.img = start_am33xx_phytec_phycore_no_spi_sdram.pblx
-am33xx-barebox-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore-no-spi.img
-
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_sram_256mb
-FILE_barebox-am33xx-phytec-phycore-mlo-256mb.img = start_am33xx_phytec_phycore_sram_256mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore-mlo-256mb.img
-
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_sram_128mb
-FILE_barebox-am33xx-phytec-phycore-mlo-128mb.img = start_am33xx_phytec_phycore_sram_128mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore-mlo-128mb.img
-
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_sram_512mb
-FILE_barebox-am33xx-phytec-phycore-mlo-512mb.img = start_am33xx_phytec_phycore_sram_512mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore-mlo-512mb.img
-
-pblx-$(CONFIG_MACH_PCM051) += start_am33xx_phytec_phycore_sram_2x512mb
-FILE_barebox-am33xx-phytec-phycore-mlo-2x512mb.img = start_am33xx_phytec_phycore_sram_2x512mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PCM051) += barebox-am33xx-phytec-phycore-mlo-2x512mb.img
-
-pblx-$(CONFIG_MACH_PFLA03) += start_am33xx_phytec_phyflex_sdram
-FILE_barebox-am33xx-phytec-phyflex.img = start_am33xx_phytec_phyflex_sdram.pblx
-am33xx-barebox-$(CONFIG_MACH_PFLA03) += barebox-am33xx-phytec-phyflex.img
-
-pblx-$(CONFIG_MACH_PFLA03) += start_am33xx_phytec_phyflex_sram_256mb
-FILE_barebox-am33xx-phytec-phyflex-mlo-256mb.img = start_am33xx_phytec_phyflex_sram_256mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PFLA03) += barebox-am33xx-phytec-phyflex-mlo-256mb.img
-
-pblx-$(CONFIG_MACH_PFLA03) += start_am33xx_phytec_phyflex_sram_512mb
-FILE_barebox-am33xx-phytec-phyflex-mlo-512mb.img = start_am33xx_phytec_phyflex_sram_512mb.pblx.mlo
-am33xx-mlo-$(CONFIG_MACH_PFLA03) += barebox-am33xx-phytec-phyflex-mlo-512mb.img
-
pblx-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += start_am33xx_phytec_phycore_sdram
FILE_barebox-am33xx-phytec-phycore.img = start_am33xx_phytec_phycore_sdram.pblx
am33xx-barebox-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += barebox-am33xx-phytec-phycore.img
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT
2015-02-04 14:00 [PATCH 1/5] ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT Wadim Egorov
` (3 preceding siblings ...)
2015-02-04 14:00 ` [PATCH 5/5] boards: Drop phytec-phycore-am335x, phytec-phyflex-am335x Wadim Egorov
@ 2015-02-06 7:23 ` Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2015-02-06 7:23 UTC (permalink / raw)
To: Wadim Egorov; +Cc: barebox
On Wed, Feb 04, 2015 at 03:00:49PM +0100, Wadim Egorov wrote:
> To support different module variants, this patch splits the phyFLEX DT
> in dts and dtsi.
>
> And we are also adding a DT for the MLO, which has all bootable devices
> disabled. The bootsource is checked in the board file and only the needed
> device is enabled and registered.
>
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
> arch/arm/boards/phytec-phyflex-am335x/board.c | 4 +
> arch/arm/boards/phytec-phyflex-am335x/lowlevel.c | 7 +-
> arch/arm/dts/Makefile | 2 +-
> arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts | 28 ++
> arch/arm/dts/am335x-phytec-phyflex-som.dts | 24 ++
> arch/arm/dts/am335x-phytec-phyflex-som.dtsi | 362 ++++++++++++++++++++++
> arch/arm/dts/am335x-phytec-phyflex.dts | 368 -----------------------
> 7 files changed, 423 insertions(+), 372 deletions(-)
> create mode 100644 arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts
> create mode 100644 arch/arm/dts/am335x-phytec-phyflex-som.dts
> create mode 100644 arch/arm/dts/am335x-phytec-phyflex-som.dtsi
> delete mode 100644 arch/arm/dts/am335x-phytec-phyflex.dts
Applied all, thanks
BTW we will probably get device tree overlay support soon. I hope that
can make such SoMs easier to handle. You could then have some core
device tree builtin and load the rest later.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread