Skip to contentSkip to conversation

ARM i.MX6: Add support for SabreSD board

PATCH In review Hubert Feurstein 2 participants 4 messages Feb 11, 2013 – Feb 12, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM i.MX6: Add support for SabreSD board

Cc Sascha Hauer <[email protected]>
Cc Steffen Trumtrar <[email protected]>

---
Changes since V1:
- rebased on latest master with arm-entry changes
- use phy_register_fixup_for_uid to register phy fixup
- register SD4 as first mmc device, so it always becomes disk0
- add self and env partition
- GbE is working with patch 'net fec_imx: add support for i.MX6 1000Mbps mode'

 arch/arm/Makefile                                  |   1 +
 arch/arm/boards/freescale-mx6-sabresd/Makefile     |   4 +
 arch/arm/boards/freescale-mx6-sabresd/board.c      | 244 +++++++++++++++++++++
 arch/arm/boards/freescale-mx6-sabresd/config.h     |   4 +
 .../freescale-mx6-sabresd/env/init/config-board    |   7 +
 .../boards/freescale-mx6-sabresd/flash_header.c    | 178 +++++++++++++++
 arch/arm/boards/freescale-mx6-sabresd/lowlevel.c   |  10 +
 arch/arm/configs/freescale-mx6-sabresd_defconfig   |  71 ++++++
 arch/arm/mach-imx/Kconfig                          |   5 +
 9 files changed, 524 insertions(+)
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/Makefile
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/board.c
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/config.h
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/env/init/config-board
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/flash_header.c
 create mode 100644 arch/arm/boards/freescale-mx6-sabresd/lowlevel.c
 create mode 100644 arch/arm/configs/freescale-mx6-sabresd_defconfig
arch/arm/Makefile +1 -0
index fcb2969..55290a9 100644
@@ -157,6 +157,7 @@ board-$(CONFIG_MACH_SABRELITE)			:= freescale-mx6-sabrelite
 board-$(CONFIG_MACH_TX53)			:= karo-tx53
 board-$(CONFIG_MACH_GUF_VINCELL)		:= guf-vincell
 board-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK)		:= efika-mx-smartbook
+board-$(CONFIG_MACH_SABRESD)			:= freescale-mx6-sabresd
 
 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
 
arch/arm/boards/freescale-mx6-sabresd/Makefile new file +4 -0
new file mode 100644
index 0000000..21fb7d9
@@ -0,0 +1,4 @@
+obj-y += board.o flash_header.o
+pbl-y += flash_header.o
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/freescale-mx6-sabresd/board.c new file +244 -0

244 lines not on this page · raw message

arch/arm/boards/freescale-mx6-sabresd/config.h new file +4 -0
new file mode 100644
index 0000000..ca15136
@@ -0,0 +1,4 @@
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
arch/arm/boards/freescale-mx6-sabresd/env/init/config-board new file +7 -0
new file mode 100644
index 0000000..cf936fb
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=SabreSD
+global.linux.bootargs.base="console=ttymxc0,115200"
arch/arm/boards/freescale-mx6-sabresd/flash_header.c new file +178 -0

178 lines not on this page · raw message

arch/arm/boards/freescale-mx6-sabresd/lowlevel.c new file +10 -0
new file mode 100644
index 0000000..aec46fd
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+	barebox_arm_entry(0x10000000, SZ_1G, 0);
+}
arch/arm/configs/freescale-mx6-sabresd_defconfig new file +71 -0

71 lines not on this page · raw message

arch/arm/mach-imx/Kconfig +5 -0
index 4115d35..e3e0e73 100644
@@ -30,6 +30,7 @@ config ARCH_TEXT_BASE
 	default 0x8fe00000 if MACH_TX53
 	default 0x7fc00000 if MACH_GUF_VINCELL
 	default 0x97f00000 if MACH_EFIKA_MX_SMARTBOOK
+	default 0x17800000 if MACH_SABRESD
 
 config BOARDINFO
 	default "Eukrea CPUIMX25" if MACH_EUKREA_CPUIMX25
@@ -59,6 +60,7 @@ config BOARDINFO
 	default "Sabre Lite" if MACH_SABRELITE
 	default "Ka-Ro tx53" if MACH_TX53
 	default "Garz+Fricke Vincell" if MACH_GUF_VINCELL
+	default "SabreSD" if MACH_SABRESD
 
 choice
 	prompt "Select boot mode"
@@ -489,6 +491,9 @@ config MACH_MX6Q_ARM2
 config MACH_SABRELITE
 	bool "Freescale i.MX6 Sabre Lite"
 
+config MACH_SABRESD
+	bool "Freescale i.MX6 SabreSD"
+
 endchoice
 
 endif
Signature · 7 lines
1.8.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#1 lore raw

Hi Hubert,

Quoted 11 lines · Hubert Feurstein
Cc Sascha Hauer <[email protected]>
Cc Steffen Trumtrar <[email protected]>

---
Changes since V1:
- rebased on latest master with arm-entry changes
- use phy_register_fixup_for_uid to register phy fixup
- register SD4 as first mmc device, so it always becomes disk0
- add self and env partition
- GbE is working with patch 'net fec_imx: add support for i.MX6 1000Mbps mode'

Applied thanks.

arch/arm/boards/freescale-mx6-sabresd/board.c line 136

Quoted 8 lines
arch/arm/boards/freescale-mx6-sabresd/board.c new file +8 -0
+
+static int sabresd_mem_init(void)
+{
+	arm_add_mem_device("ram0", 0x10000000, SZ_1G);
+
+	return 0;
+}
+mem_initcall(sabresd_mem_init);

This is not necessary anymore. I removed this while applying. Could you verify this still works?

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Hi Sascha,

2013/2/11 Sascha Hauer <[email protected]>:
[...]

Quoted 11 lines

arch/arm/boards/freescale-mx6-sabresd/board.c line 136

Quoted 8 lines
arch/arm/boards/freescale-mx6-sabresd/board.c new file +8 -0
+
+static int sabresd_mem_init(void)
+{
+     arm_add_mem_device("ram0", 0x10000000, SZ_1G);
+
+     return 0;
+}
+mem_initcall(sabresd_mem_init);

This is not necessary anymore. I removed this while applying. Could you verify this still works?

No, it does not. Here's the log:

barebox 2013.02.0-00270-g4bb21a7 #158 Tue Feb 12 09:34:12 CET 2013

Board: SabreSD
mmu: Error: Can't request SDRAM region for ttb
Error: Cannot request SDRAM region for stack
registered netconsole as cs1
imx-esdhc imx-esdhc3: registered as imx-esdhc3
detected card version 4.0
mci mci0: registered disk0
mci mci0: No partition table found
imx-esdhc imx-esdhc1: registered as imx-esdhc1
mci mci1: no card inserted
imx-esdhc imx-esdhc2: registered as imx-esdhc2
mci mci2: registered disk1
mci mci2: No partition table found

BUG: failure at arch/arm/cpu/mmu.c:122/find_pte()!

BUG!
[<1781bd3d>] (unwind_backtrace+0x1/0x64) from [<1780fffd>] (panic+0x1d/0x2c) [<1780fffd>] (panic+0x1d/0x2c) from [<1781c7f5>] (remap_range+0x29/0x88) [<1781c7f5>] (remap_range+0x29/0x88) from [<1781c8a3>] (dma_alloc_coherent+0x2f/0x38)
[<1781c8a3>] (dma_alloc_coherent+0x2f/0x38) from [<178084c3>] (fec_probe+0x8f/0x17c)
[<178084c3>] (fec_probe+0x8f/0x17c) from [<17807d81>] (platform_probe+0x9/0xa) [<17807d81>] (platform_probe+0x9/0xa) from [<17807ba7>] (device_probe+0xb/0x38) [<17807ba7>] (device_probe+0xb/0x38) from [<17807bf3>] (match+0x1f/0x30) [<17807bf3>] (match+0x1f/0x30) from [<17807d05>] (register_device+0x81/0xb0) [<17807d05>] (register_device+0x81/0xb0) from [<17807e11>] (add_generic_device_res+0x2d/0x32)
[<17807e11>] (add_generic_device_res+0x2d/0x32) from [<1781acbb>] (imx_add_fec_imx6+0x1f/0x28)
[<1781acbb>] (imx_add_fec_imx6+0x1f/0x28) from [<178197e9>] (sabresd_devices_init+0x81/0x10c)
[<178197e9>] (sabresd_devices_init+0x81/0x10c) from [<178068d9>] (start_barebox+0x15/0xc0)
[<178068d9>] (start_barebox+0x15/0xc0) from [<1781c237>] (__start.isra.0+0x4b/0x54)
[<1781c237>] (__start.isra.0+0x4b/0x54) from [<1781c24d>] (setup_c+0x1/0x48)

Hubert

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer
#3 lore raw
Quoted 15 lines · Hubert Feurstein

Hi Sascha,

2013/2/11 Sascha Hauer <[email protected]>:
[...]

Quoted 11 lines

arch/arm/boards/freescale-mx6-sabresd/board.c line 136

Quoted 8 lines
arch/arm/boards/freescale-mx6-sabresd/board.c new file +8 -0
+
+static int sabresd_mem_init(void)
+{
+     arm_add_mem_device("ram0", 0x10000000, SZ_1G);
+
+     return 0;
+}
+mem_initcall(sabresd_mem_init);

This is not necessary anymore. I removed this while applying. Could you verify this still works?

Quoted 1 line

No, it does not. Here's the log:

Ah, damn, there is no SDRAM size detection for i.MX6 (yet). I forgot about this. I'll revert this to your original patch then.

Sascha

Quoted 43 lines

barebox 2013.02.0-00270-g4bb21a7 #158 Tue Feb 12 09:34:12 CET 2013

Board: SabreSD
mmu: Error: Can't request SDRAM region for ttb
Error: Cannot request SDRAM region for stack
registered netconsole as cs1
imx-esdhc imx-esdhc3: registered as imx-esdhc3
detected card version 4.0
mci mci0: registered disk0
mci mci0: No partition table found
imx-esdhc imx-esdhc1: registered as imx-esdhc1
mci mci1: no card inserted
imx-esdhc imx-esdhc2: registered as imx-esdhc2
mci mci2: registered disk1
mci mci2: No partition table found

BUG: failure at arch/arm/cpu/mmu.c:122/find_pte()!

BUG!
[<1781bd3d>] (unwind_backtrace+0x1/0x64) from [<1780fffd>] (panic+0x1d/0x2c) [<1780fffd>] (panic+0x1d/0x2c) from [<1781c7f5>] (remap_range+0x29/0x88) [<1781c7f5>] (remap_range+0x29/0x88) from [<1781c8a3>] (dma_alloc_coherent+0x2f/0x38)
[<1781c8a3>] (dma_alloc_coherent+0x2f/0x38) from [<178084c3>] (fec_probe+0x8f/0x17c)
[<178084c3>] (fec_probe+0x8f/0x17c) from [<17807d81>] (platform_probe+0x9/0xa) [<17807d81>] (platform_probe+0x9/0xa) from [<17807ba7>] (device_probe+0xb/0x38) [<17807ba7>] (device_probe+0xb/0x38) from [<17807bf3>] (match+0x1f/0x30) [<17807bf3>] (match+0x1f/0x30) from [<17807d05>] (register_device+0x81/0xb0) [<17807d05>] (register_device+0x81/0xb0) from [<17807e11>] (add_generic_device_res+0x2d/0x32)
[<17807e11>] (add_generic_device_res+0x2d/0x32) from [<1781acbb>] (imx_add_fec_imx6+0x1f/0x28)
[<1781acbb>] (imx_add_fec_imx6+0x1f/0x28) from [<178197e9>] (sabresd_devices_init+0x81/0x10c)
[<178197e9>] (sabresd_devices_init+0x81/0x10c) from [<178068d9>] (start_barebox+0x15/0xc0)
[<178068d9>] (start_barebox+0x15/0xc0) from [<1781c237>] (__start.isra.0+0x4b/0x54)
[<1781c237>] (__start.isra.0+0x4b/0x54) from [<1781c24d>] (setup_c+0x1/0x48)

Hubert

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox