linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* N900 device tree conversion: how to do first step
@ 2013-06-09  1:59 Pavel Machek
  2013-06-09  9:24 ` Pali Rohár
                   ` (3 more replies)
  0 siblings, 4 replies; 46+ messages in thread
From: Pavel Machek @ 2013-06-09  1:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

I'd like to convert Nokia N900 to device tree.

Unfortunately, serial port is not easily available (very special cable
would be needed, does someone know where to get one?) and I don't have
BDI (and very special cable would be needed, too).

So I tried doing very small first step, hoping that I get booting
system... obviously I did not.

I tried formally switching to device tree while still booting using
hardcoded functions. No luck. Does anyone see what I did wrong?

Is it possible that n900 has its main memory somewhere else than
0x80000000?

Thanks,
									Pavel

diff --git a/.config b/.config
index a36bbe2..130a7a8 100644
--- a/.config
+++ b/.config
@@ -498,11 +498,11 @@ CONFIG_ATAGS=y
 # CONFIG_DEPRECATED_PARAM_STRUCT is not set
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-# CONFIG_ARM_APPENDED_DTB is not set
-CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs rootflags=bulk_read,no_chk_data_crc rw mtdoops.mtddev=log console=tty0 console=ttyO2"
-CONFIG_CMDLINE_FROM_BOOTLOADER=y
-# CONFIG_CMDLINE_EXTEND is not set
-# CONFIG_CMDLINE_FORCE is not set
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y
+CONFIG_CMDLINE=""
 CONFIG_KEXEC=y
 CONFIG_ATAGS_PROC=y
 # CONFIG_CRASH_DUMP is not set
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..7b1a075 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -119,6 +119,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
 	omap3-tobi.dtb \
+	omap3-n900.dtb \
 	omap4-panda.dtb \
 	omap4-panda-a4.dtb \
 	omap4-panda-es.dtb \
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
new file mode 100644
index 0000000..e093543
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+/* FIXME: "omap3.dtsi" */
+
+/ {
+	model = "Nokia N900";
+	compatible = "nokia,omap3-n900", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+};
+
+/*
+&mmc1 {
+	status = "disabled";
+};
+
+&mmc2 {
+	status = "disabled";
+};
+
+&mmc3 {
+	status = "disabled";
+};
+*/
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 74f83a5..f857b5b 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -36,6 +36,8 @@
 
 #define RX51_GPIO_SLEEP_IND 162
 
+/* This lights up left part of keyboard */
+
 static struct gpio_led gpio_leds[] = {
 	{
 		.name	= "sleep_ind",
@@ -119,21 +121,21 @@ static void __init rx51_init(void)
 	platform_device_register(&leds_gpio);
 }
 
-static void __init rx51_reserve(void)
-{
-	omap_reserve();
-}
+static const char *omap3_boards_compat[] __initdata = {
+	"nokia,omap3-n900",
+        NULL,
+};
 
-MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
-	/* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
-	.atag_offset	= 0x100,
-	.reserve	= rx51_reserve,
+DT_MACHINE_START(N900_DT, "Nokia N900 (Flattened Device Tree)")
+	.atag_offset    = 0x100,
+	.reserve	= omap_reserve,
 	.map_io		= omap3_map_io,
-	.init_early	= omap3430_init_early,
-	.init_irq	= omap3_init_irq,
-	.handle_irq	= omap3_intc_handle_irq,
-	.init_machine	= rx51_init,
-	.init_late	= omap3430_init_late,
-	.init_time	= omap3_sync32k_timer_init,
-	.restart	= omap3xxx_restart,
+	.init_early     = omap3430_init_early,
+	.init_irq       = omap3_init_irq, /* FIXME: omap_intc_of_init, */
+	.handle_irq     = omap3_intc_handle_irq,
+	.init_machine   = rx51_init, /* FIXME: omap_generic_init, */
+	.init_late      = omap3430_init_late, /* FIXME: omap3_init_late, */
+	.init_time      = omap3_sync32k_timer_init,
+	.dt_compat      = omap3_boards_compat,
+	.restart        = omap3xxx_restart,
 MACHINE_END
diff --git a/mkit b/mkit
index 354610c..e9ffc02 100755
--- a/mkit
+++ b/mkit
@@ -1,3 +1,4 @@
 #!/bin/bash
 ARCH=arm time make -j 3 && \
-    sudo ../maemo/0xffff/src/0xFFFF -m arch/arm/boot/zImage -l -b 'root=/dev/mmcblk0p6 rootwait'
\ No newline at end of file
+    cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n900.dtb > zImage_dtb && \
+    sudo ../maemo/0xffff/src/0xFFFF -m zImage_dtb -l -b 'root=/dev/mmcblk0p6 rootwait'
\ No newline at end of file


 
 
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2013-08-13 14:06 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-09  1:59 N900 device tree conversion: how to do first step Pavel Machek
2013-06-09  9:24 ` Pali Rohár
2013-06-09 16:47   ` Pavel Machek
2013-06-09 17:03     ` Pali Rohár
2013-06-09 17:30 ` Pavel Machek
2013-06-09 20:11 ` Aaro Koskinen
2013-06-13 13:26   ` Pavel Machek
2013-06-13 14:10     ` Tony Lindgren
2013-06-13 14:28       ` Pavel Machek
2013-06-13 14:57         ` Tony Lindgren
2013-06-13 15:52           ` Pavel Machek
2013-06-13 16:14             ` Tony Lindgren
2013-06-13 23:08               ` Pavel Machek
2013-06-14  5:56                 ` Tony Lindgren
2013-06-14 21:28                   ` Pavel Machek
2013-06-17 11:10                     ` Tony Lindgren
2013-07-01 14:03                       ` [PATCH] N900: fix operation on emulator Pavel Machek
2013-07-01 18:22                         ` Sergei Shtylyov
2013-07-01 19:51                           ` Pavel Machek
2013-07-01 20:00                             ` Sergei Shtylyov
2013-07-01 20:53                           ` Pavel Machek
2013-07-01 21:15                       ` [PATCH] N900: enable N900-specific drivers even if device tree is enabled Pavel Machek
2013-07-04 11:47                         ` Tony Lindgren
2013-07-01 21:17                       ` [PATCH] N900: add device tree Pavel Machek
2013-07-04 17:19                         ` Aaro Koskinen
2013-07-04 20:21                           ` Pavel Machek
2013-07-04 20:32                             ` Aaro Koskinen
2013-07-13 12:17                               ` [PATCH v2] " Pavel Machek
2013-07-14 22:28                                 ` Aaro Koskinen
2013-07-28 13:44                                   ` Pavel Machek
2013-08-01 23:43                                     ` Pavel Machek
2013-08-10 11:09                                       ` Pavel Machek
2013-08-10 11:27                                         ` [PATCH] ARM: dts: omap3 / n900 support, Benoit please take me (was Re: [PATCH v2] N900: add device tree) Pavel Machek
2013-08-10 11:46                                         ` [PATCH v2] N900: add device tree Belisko Marek
2013-08-10 20:29                                           ` Jiri Kosina
2013-08-11  0:55                                             ` OMAP device tree maintainance (was Re: [PATCH v2] N900: add device tree) Pavel Machek
2013-08-11 11:50                                             ` [PATCH v2] N900: add device tree Javier Martinez Canillas
2013-08-11 13:47                                               ` Pavel Machek
2013-08-12  7:37                                                 ` Tony Lindgren
2013-08-12  7:36                                             ` Tony Lindgren
2013-08-11 15:02                                 ` Javier Martinez Canillas
2013-08-13 10:50                                   ` Benoit Cousson
2013-08-13 13:36                                     ` [PATCH v3] " Pavel Machek
2013-08-13 14:06                                       ` Benoit Cousson
2013-07-19 18:14 ` N900 device tree conversion: how to do first step Sebastian Reichel
2013-07-28 13:37   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).