mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe
@ 2014-04-07  7:38 Antony Pavlov
  2014-04-07  7:38 ` [PATCH 1/3] MIPS: add Longson LS1B SoC dtsi file Antony Pavlov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-04-07  7:38 UTC (permalink / raw)
  To: barebox

New boards should probe from devicetree and
not use the platform registration code.

This patchseries adds device tree stuff for
Longson LS1B SoC and Loongson Tech LS1B Demo Board.

Antony Pavlov (3):
  MIPS: add Longson LS1B SoC dtsi file
  MIPS: add Loongson Tech LS1B Demo Board dts file
  MIPS: loongson-ls1b: switch to device tree

 arch/mips/boards/loongson-ls1b/Makefile   |  1 -
 arch/mips/boards/loongson-ls1b/ram.c      | 12 ---------
 arch/mips/boards/loongson-ls1b/serial.c   | 12 ---------
 arch/mips/configs/loongson-ls1b_defconfig |  6 +++++
 arch/mips/dts/loongson-ls1b.dts           | 16 ++++++++++++
 arch/mips/dts/ls1b.dtsi                   | 43 +++++++++++++++++++++++++++++++
 6 files changed, 65 insertions(+), 25 deletions(-)
 delete mode 100644 arch/mips/boards/loongson-ls1b/ram.c
 create mode 100644 arch/mips/dts/loongson-ls1b.dts
 create mode 100644 arch/mips/dts/ls1b.dtsi

-- 
1.9.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/3] MIPS: add Longson LS1B SoC dtsi file
  2014-04-07  7:38 [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Antony Pavlov
@ 2014-04-07  7:38 ` Antony Pavlov
  2014-04-07  7:38 ` [PATCH 2/3] MIPS: add Loongson Tech LS1B Demo Board dts file Antony Pavlov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-04-07  7:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/dts/ls1b.dtsi | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/mips/dts/ls1b.dtsi b/arch/mips/dts/ls1b.dtsi
new file mode 100644
index 0000000..f4ff8b6
--- /dev/null
+++ b/arch/mips/dts/ls1b.dtsi
@@ -0,0 +1,43 @@
+#include "skeleton.dtsi"
+
+/ {
+	soc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		device_type = "soc";
+		ranges;
+
+		serial0: serial@bfe40000 {
+			compatible = "ns16550a";
+			reg = <0xbfe40000 0x8>;
+			reg-shift = <0>;
+			clock-frequency = <83000000>;
+			status = "disabled";
+		};
+
+		serial1: serial@bfe44000 {
+			compatible = "ns16550a";
+			reg = <0xbfe44000 0x8>;
+			reg-shift = <0>;
+			clock-frequency = <83000000>;
+			status = "disabled";
+		};
+
+		serial2: serial@bfe48000 {
+			compatible = "ns16550a";
+			reg = <0xbfe48000 0x8>;
+			reg-shift = <0>;
+			clock-frequency = <83000000>;
+			status = "disabled";
+		};
+
+		serial3: serial@bfe4c000 {
+			compatible = "ns16550a";
+			reg = <0xbfe4c000 0x8>;
+			reg-shift = <0>;
+			clock-frequency = <83000000>;
+			status = "disabled";
+		};
+	};
+};
-- 
1.9.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/3] MIPS: add Loongson Tech LS1B Demo Board dts file
  2014-04-07  7:38 [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Antony Pavlov
  2014-04-07  7:38 ` [PATCH 1/3] MIPS: add Longson LS1B SoC dtsi file Antony Pavlov
@ 2014-04-07  7:38 ` Antony Pavlov
  2014-04-07  7:38 ` [PATCH 3/3] MIPS: loongson-ls1b: switch to device tree Antony Pavlov
  2014-04-08  6:06 ` [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Sascha Hauer
  3 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-04-07  7:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/dts/loongson-ls1b.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/mips/dts/loongson-ls1b.dts b/arch/mips/dts/loongson-ls1b.dts
new file mode 100644
index 0000000..b81a951
--- /dev/null
+++ b/arch/mips/dts/loongson-ls1b.dts
@@ -0,0 +1,16 @@
+/dts-v1/;
+
+#include "ls1b.dtsi"
+
+/ {
+	model = "Loongson Tech LS1B Demo Board";
+	compatible = "loongson,ls1b";
+
+	memory {
+		reg = <0x00000000 0x4000000>;
+	};
+};
+
+&serial2 {
+	status = "okay";
+};
-- 
1.9.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/3] MIPS: loongson-ls1b: switch to device tree
  2014-04-07  7:38 [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Antony Pavlov
  2014-04-07  7:38 ` [PATCH 1/3] MIPS: add Longson LS1B SoC dtsi file Antony Pavlov
  2014-04-07  7:38 ` [PATCH 2/3] MIPS: add Loongson Tech LS1B Demo Board dts file Antony Pavlov
@ 2014-04-07  7:38 ` Antony Pavlov
  2014-04-08  6:06 ` [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Sascha Hauer
  3 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-04-07  7:38 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boards/loongson-ls1b/Makefile   |  1 -
 arch/mips/boards/loongson-ls1b/ram.c      | 12 ------------
 arch/mips/boards/loongson-ls1b/serial.c   | 12 ------------
 arch/mips/configs/loongson-ls1b_defconfig |  6 ++++++
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/arch/mips/boards/loongson-ls1b/Makefile b/arch/mips/boards/loongson-ls1b/Makefile
index a21952b..31c0629 100644
--- a/arch/mips/boards/loongson-ls1b/Makefile
+++ b/arch/mips/boards/loongson-ls1b/Makefile
@@ -1,2 +1 @@
-obj-y += ram.o
 obj-y += serial.o
diff --git a/arch/mips/boards/loongson-ls1b/ram.c b/arch/mips/boards/loongson-ls1b/ram.c
deleted file mode 100644
index 9e655ab..0000000
--- a/arch/mips/boards/loongson-ls1b/ram.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <common.h>
-#include <init.h>
-#include <sizes.h>
-#include <asm/memory.h>
-
-static int mem_init(void)
-{
-	mips_add_ram0(SZ_64M);
-
-	return 0;
-}
-mem_initcall(mem_init);
diff --git a/arch/mips/boards/loongson-ls1b/serial.c b/arch/mips/boards/loongson-ls1b/serial.c
index d8e0f7c..a9453ed 100644
--- a/arch/mips/boards/loongson-ls1b/serial.c
+++ b/arch/mips/boards/loongson-ls1b/serial.c
@@ -1,22 +1,10 @@
 #include <common.h>
 #include <init.h>
-#include <ns16550.h>
-
-#include <mach/loongson1.h>
-
-static struct NS16550_plat serial_plat = {
-	.clock = 83000000,
-	.shift = 0,
-};
 
 static int console_init(void)
 {
-	barebox_set_model("Loongson Tech LS1B Demo Board");
 	barebox_set_hostname("ls1b");
 
-	add_ns16550_device(DEVICE_ID_DYNAMIC, KSEG1ADDR(LS1X_UART2_BASE),
-		8, IORESOURCE_MEM_8BIT, &serial_plat);
-
 	return 0;
 }
 console_initcall(console_init);
diff --git a/arch/mips/configs/loongson-ls1b_defconfig b/arch/mips/configs/loongson-ls1b_defconfig
index 0322052..bc48aba 100644
--- a/arch/mips/configs/loongson-ls1b_defconfig
+++ b/arch/mips/configs/loongson-ls1b_defconfig
@@ -1,3 +1,5 @@
+CONFIG_BUILTIN_DTB=y
+CONFIG_BUILTIN_DTB_NAME="loongson-ls1b"
 CONFIG_MACH_MIPS_LOONGSON=y
 CONFIG_PBL_IMAGE=y
 CONFIG_STACK_SIZE=0x7000
@@ -36,7 +38,11 @@ CONFIG_CMD_IOMEM=y
 CONFIG_FLEXIBLE_BOOTARGS=y
 CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OF_NODE=y
 CONFIG_CMD_TIMEOUT=y
+CONFIG_OFDEVICE=y
 # CONFIG_SPI is not set
 CONFIG_ZLIB=y
 CONFIG_BZLIB=y
-- 
1.9.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe
  2014-04-07  7:38 [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Antony Pavlov
                   ` (2 preceding siblings ...)
  2014-04-07  7:38 ` [PATCH 3/3] MIPS: loongson-ls1b: switch to device tree Antony Pavlov
@ 2014-04-08  6:06 ` Sascha Hauer
  2014-04-08  7:13   ` Antony Pavlov
  3 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2014-04-08  6:06 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Apr 07, 2014 at 11:38:46AM +0400, Antony Pavlov wrote:
> New boards should probe from devicetree and
> not use the platform registration code.
> 
> This patchseries adds device tree stuff for
> Longson LS1B SoC and Loongson Tech LS1B Demo Board.
> 
> Antony Pavlov (3):
>   MIPS: add Longson LS1B SoC dtsi file
>   MIPS: add Loongson Tech LS1B Demo Board dts file
>   MIPS: loongson-ls1b: switch to device tree

Applied, thanks.

BTW what's the status of mips devicetree support in Linux Mainline? I
sometimes have a look at arch/mips/boot/dts there and find it empty.
Does the kernel start with the devicetrees you add to barebox?

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] 7+ messages in thread

* Re: [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe
  2014-04-08  6:06 ` [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Sascha Hauer
@ 2014-04-08  7:13   ` Antony Pavlov
  2014-04-10  6:21     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Antony Pavlov @ 2014-04-08  7:13 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Tue, 8 Apr 2014 08:06:19 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> On Mon, Apr 07, 2014 at 11:38:46AM +0400, Antony Pavlov wrote:
> > New boards should probe from devicetree and
> > not use the platform registration code.
> > 
> > This patchseries adds device tree stuff for
> > Longson LS1B SoC and Loongson Tech LS1B Demo Board.
> > 
> > Antony Pavlov (3):
> >   MIPS: add Longson LS1B SoC dtsi file
> >   MIPS: add Loongson Tech LS1B Demo Board dts file
> >   MIPS: loongson-ls1b: switch to device tree
> 
> Applied, thanks.
> 
> BTW what's the status of mips devicetree support in Linux Mainline? I
> sometimes have a look at arch/mips/boot/dts there and find it empty.
> Does the kernel start with the devicetrees you add to barebox?

linux-mips world is different from linux-arm world in many ways :)

$ find linux.git/arch/mips/ -iname '*dts*'
linux.git/arch/mips/mti-sead3/sead3.dts
linux.git/arch/mips/boot/dts
linux.git/arch/mips/ralink/dts
linux.git/arch/mips/ralink/dts/rt2880_eval.dts
linux.git/arch/mips/ralink/dts/mt7620a.dtsi
linux.git/arch/mips/ralink/dts/rt2880.dtsi
linux.git/arch/mips/ralink/dts/rt3883.dtsi
linux.git/arch/mips/ralink/dts/rt3883_eval.dts
linux.git/arch/mips/ralink/dts/rt3052_eval.dts
linux.git/arch/mips/ralink/dts/rt3050.dtsi
linux.git/arch/mips/ralink/dts/mt7620a_eval.dts
linux.git/arch/mips/lantiq/dts
linux.git/arch/mips/lantiq/dts/easy50712.dts
linux.git/arch/mips/lantiq/dts/danube.dtsi
linux.git/arch/mips/netlogic/dts
linux.git/arch/mips/netlogic/dts/xlp_gvp.dts
linux.git/arch/mips/netlogic/dts/xlp_evp.dts
linux.git/arch/mips/netlogic/dts/xlp_fvp.dts
linux.git/arch/mips/netlogic/dts/xlp_svp.dts
linux.git/arch/mips/cavium-octeon/octeon_3xxx.dts
linux.git/arch/mips/cavium-octeon/octeon_68xx.dts


So there is no support in barebox for a mainline linux dts-capable machine.

I have revived my qemu-malta linux-boot-capable barebox branch
(it also introduces PCI support, but I have to clean it):

   https://github.com/frantony/barebox/tree/next.mips-malta-elf-linux.20140408

So there is a chance to organize qemu-barebox-linux dts-capable system.

Also AR9331-based system has a chances to be converted to dt.
There is some notes on AR9331 support:

   * some of AR933x linux-mainline devices are dt-capable
      (but mips ath79 mainline kernel code is not dt-capable);
       may be there is some ar933x kernel branch with dt support?
   * I have to port AR933x Ethernet driver to barebox so
     barebox will be capable to load linux kernel quickly and comfortably;
   * kexec code for booting linux kernel already realized for qemu-malta;
     there are possible some cache support issues (qemu-mips does no support caches),
     but draft cache support code is already stolen from u-boot.

Loongson developers have no plan to port OpenFirmware in the near future,
see this
   http://www.linux-mips.org/archives/linux-mips/2014-03/msg00164.html
   
-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe
  2014-04-08  7:13   ` Antony Pavlov
@ 2014-04-10  6:21     ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2014-04-10  6:21 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Tue, Apr 08, 2014 at 11:13:50AM +0400, Antony Pavlov wrote:
> On Tue, 8 Apr 2014 08:06:19 +0200
> Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> > On Mon, Apr 07, 2014 at 11:38:46AM +0400, Antony Pavlov wrote:
> > > New boards should probe from devicetree and
> > > not use the platform registration code.
> > > 
> > > This patchseries adds device tree stuff for
> > > Longson LS1B SoC and Loongson Tech LS1B Demo Board.
> > > 
> > > Antony Pavlov (3):
> > >   MIPS: add Longson LS1B SoC dtsi file
> > >   MIPS: add Loongson Tech LS1B Demo Board dts file
> > >   MIPS: loongson-ls1b: switch to device tree
> > 
> > Applied, thanks.
> > 
> > BTW what's the status of mips devicetree support in Linux Mainline? I
> > sometimes have a look at arch/mips/boot/dts there and find it empty.
> > Does the kernel start with the devicetrees you add to barebox?
> 
> linux-mips world is different from linux-arm world in many ways :)
> 
> $ find linux.git/arch/mips/ -iname '*dts*'
> linux.git/arch/mips/mti-sead3/sead3.dts
> linux.git/arch/mips/boot/dts
> linux.git/arch/mips/ralink/dts
> linux.git/arch/mips/ralink/dts/rt2880_eval.dts
> linux.git/arch/mips/ralink/dts/mt7620a.dtsi
> linux.git/arch/mips/ralink/dts/rt2880.dtsi
> linux.git/arch/mips/ralink/dts/rt3883.dtsi
> linux.git/arch/mips/ralink/dts/rt3883_eval.dts
> linux.git/arch/mips/ralink/dts/rt3052_eval.dts
> linux.git/arch/mips/ralink/dts/rt3050.dtsi
> linux.git/arch/mips/ralink/dts/mt7620a_eval.dts
> linux.git/arch/mips/lantiq/dts
> linux.git/arch/mips/lantiq/dts/easy50712.dts
> linux.git/arch/mips/lantiq/dts/danube.dtsi
> linux.git/arch/mips/netlogic/dts
> linux.git/arch/mips/netlogic/dts/xlp_gvp.dts
> linux.git/arch/mips/netlogic/dts/xlp_evp.dts
> linux.git/arch/mips/netlogic/dts/xlp_fvp.dts
> linux.git/arch/mips/netlogic/dts/xlp_svp.dts
> linux.git/arch/mips/cavium-octeon/octeon_3xxx.dts
> linux.git/arch/mips/cavium-octeon/octeon_68xx.dts

Ah, there they are.

> 
> So there is no support in barebox for a mainline linux dts-capable machine.

Ok, then we do not need to make the dts files Linux mainline compatible.
You probably keep an eye on the mips development so that we won't end up
with conflicting devicetrees.

> 
> Loongson developers have no plan to port OpenFirmware in the near future,
> see this
>    http://www.linux-mips.org/archives/linux-mips/2014-03/msg00164.html

Uh, not nice :(

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] 7+ messages in thread

end of thread, other threads:[~2014-04-10  6:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07  7:38 [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Antony Pavlov
2014-04-07  7:38 ` [PATCH 1/3] MIPS: add Longson LS1B SoC dtsi file Antony Pavlov
2014-04-07  7:38 ` [PATCH 2/3] MIPS: add Loongson Tech LS1B Demo Board dts file Antony Pavlov
2014-04-07  7:38 ` [PATCH 3/3] MIPS: loongson-ls1b: switch to device tree Antony Pavlov
2014-04-08  6:06 ` [PATCH 0/3] MIPS: loongson-ls1b: switch to device tree probe Sascha Hauer
2014-04-08  7:13   ` Antony Pavlov
2014-04-10  6:21     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox