* [PATCH] MIPS: qemu-malta: switch to devicetree
@ 2013-09-03 4:33 Antony Pavlov
2013-09-03 4:41 ` Antony Pavlov
2013-09-04 6:33 ` Sascha Hauer
0 siblings, 2 replies; 7+ messages in thread
From: Antony Pavlov @ 2013-09-03 4:33 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/boards/qemu-malta/init.c | 31 ++-----------------------------
arch/mips/configs/qemu-malta_defconfig | 1 +
arch/mips/dts/qemu-malta.dts | 33 +++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 29 deletions(-)
diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
index ddc90dc..4d12495 100644
--- a/arch/mips/boards/qemu-malta/init.c
+++ b/arch/mips/boards/qemu-malta/init.c
@@ -17,39 +17,12 @@
*/
#include <common.h>
-#include <types.h>
-#include <driver.h>
#include <init.h>
-#include <ns16550.h>
-#include <mach/hardware.h>
-#include <partition.h>
-#include <sizes.h>
-static int malta_devices_init(void)
+static int malta_core_init(void)
{
- add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
-
- devfs_add_partition("nor0", 0x0, SZ_512K, DEVFS_PARTITION_FIXED, "self");
- devfs_add_partition("nor0", SZ_512K, SZ_64K, DEVFS_PARTITION_FIXED, "env0");
-
- return 0;
-}
-device_initcall(malta_devices_init);
-
-static struct NS16550_plat serial_plat = {
- .clock = 1843200, /* no matter for emulated port */
- .shift = 0,
-};
-
-static int malta_console_init(void)
-{
- barebox_set_model("qemu malta");
barebox_set_hostname("malta");
- /* Register the serial port */
- add_ns16550_device(DEVICE_ID_DYNAMIC, MALTA_PIIX4_UART0, 8,
- IORESOURCE_MEM_8BIT, &serial_plat);
-
return 0;
}
-console_initcall(malta_console_init);
+core_initcall(malta_core_init);
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index 18c840d..1b9ee9a 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -54,6 +54,7 @@ CONFIG_NET_PING=y
CONFIG_NET_NETCONSOLE=y
CONFIG_NET_RESOLV=y
CONFIG_OFDEVICE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
# CONFIG_SPI is not set
CONFIG_MTD=y
CONFIG_DRIVER_CFI=y
diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
index c4dcf05..4057729 100644
--- a/arch/mips/dts/qemu-malta.dts
+++ b/arch/mips/dts/qemu-malta.dts
@@ -6,7 +6,40 @@
model = "qemu malta";
compatible = "qemu,malta";
+ chosen {
+ environment@0 {
+ compatible = "barebox,environment";
+ device-path = &nor0, "partname:barebox-environment";
+ };
+ };
+
memory {
reg = <0x00000000 0x10000000>;
};
+
+ uart0: serial@b00003f8 {
+ compatible = "ns16550a";
+ reg = <0xb00003f8 0x08>;
+ reg-shift = <0>;
+ /* no matter for emulated port */
+ clock-frequency = <1843200>;
+ };
+
+ nor0: flash@be000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "cfi-flash";
+ reg = <0xbe000000 0x00400000>;
+
+ partition@0 {
+ label = "barebox";
+ reg = <0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "barebox-environment";
+ reg = <0x80000 0x10000>;
+ };
+ };
};
--
1.8.4.rc3
_______________________________________________
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] MIPS: qemu-malta: switch to devicetree
2013-09-03 4:33 [PATCH] MIPS: qemu-malta: switch to devicetree Antony Pavlov
@ 2013-09-03 4:41 ` Antony Pavlov
2013-09-03 11:21 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 6:33 ` Sascha Hauer
1 sibling, 1 reply; 7+ messages in thread
From: Antony Pavlov @ 2013-09-03 4:41 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On Tue, 3 Sep 2013 08:33:33 +0400
Antony Pavlov <antonynpavlov@gmail.com> wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
> arch/mips/boards/qemu-malta/init.c | 31 ++-----------------------------
> arch/mips/configs/qemu-malta_defconfig | 1 +
> arch/mips/dts/qemu-malta.dts | 33 +++++++++++++++++++++++++++++++++
> 3 files changed, 36 insertions(+), 29 deletions(-)
>
> diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
> index ddc90dc..4d12495 100644
> --- a/arch/mips/boards/qemu-malta/init.c
> +++ b/arch/mips/boards/qemu-malta/init.c
> @@ -17,39 +17,12 @@
> */
>
> #include <common.h>
> -#include <types.h>
> -#include <driver.h>
> #include <init.h>
> -#include <ns16550.h>
> -#include <mach/hardware.h>
> -#include <partition.h>
> -#include <sizes.h>
>
> -static int malta_devices_init(void)
> +static int malta_core_init(void)
> {
> - add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
> -
> - devfs_add_partition("nor0", 0x0, SZ_512K, DEVFS_PARTITION_FIXED, "self");
> - devfs_add_partition("nor0", SZ_512K, SZ_64K, DEVFS_PARTITION_FIXED, "env0");
> -
> - return 0;
> -}
> -device_initcall(malta_devices_init);
> -
> -static struct NS16550_plat serial_plat = {
> - .clock = 1843200, /* no matter for emulated port */
> - .shift = 0,
> -};
> -
> -static int malta_console_init(void)
> -{
> - barebox_set_model("qemu malta");
> barebox_set_hostname("malta");
>
May be it is reasonable to add hostname support to dts?
The lonely barebox_set_hostname() in the malta board code looks very pathetically :)
> - /* Register the serial port */
> - add_ns16550_device(DEVICE_ID_DYNAMIC, MALTA_PIIX4_UART0, 8,
> - IORESOURCE_MEM_8BIT, &serial_plat);
> -
> return 0;
> }
> -console_initcall(malta_console_init);
> +core_initcall(malta_core_init);
> diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
> index 18c840d..1b9ee9a 100644
> --- a/arch/mips/configs/qemu-malta_defconfig
> +++ b/arch/mips/configs/qemu-malta_defconfig
> @@ -54,6 +54,7 @@ CONFIG_NET_PING=y
> CONFIG_NET_NETCONSOLE=y
> CONFIG_NET_RESOLV=y
> CONFIG_OFDEVICE=y
> +CONFIG_OF_BAREBOX_DRIVERS=y
> # CONFIG_SPI is not set
> CONFIG_MTD=y
> CONFIG_DRIVER_CFI=y
> diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
> index c4dcf05..4057729 100644
> --- a/arch/mips/dts/qemu-malta.dts
> +++ b/arch/mips/dts/qemu-malta.dts
> @@ -6,7 +6,40 @@
> model = "qemu malta";
> compatible = "qemu,malta";
>
> + chosen {
> + environment@0 {
> + compatible = "barebox,environment";
> + device-path = &nor0, "partname:barebox-environment";
> + };
> + };
> +
> memory {
> reg = <0x00000000 0x10000000>;
> };
> +
> + uart0: serial@b00003f8 {
> + compatible = "ns16550a";
> + reg = <0xb00003f8 0x08>;
> + reg-shift = <0>;
> + /* no matter for emulated port */
> + clock-frequency = <1843200>;
> + };
> +
> + nor0: flash@be000000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "cfi-flash";
> + reg = <0xbe000000 0x00400000>;
> +
> + partition@0 {
> + label = "barebox";
> + reg = <0 0x80000>;
> + read-only;
> + };
> +
> + partition@80000 {
> + label = "barebox-environment";
> + reg = <0x80000 0x10000>;
> + };
> + };
> };
> --
> 1.8.4.rc3
>
--
--
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] MIPS: qemu-malta: switch to devicetree
2013-09-03 4:41 ` Antony Pavlov
@ 2013-09-03 11:21 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 6:30 ` Sascha Hauer
0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-03 11:21 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On 08:41 Tue 03 Sep , Antony Pavlov wrote:
> On Tue, 3 Sep 2013 08:33:33 +0400
> Antony Pavlov <antonynpavlov@gmail.com> wrote:
>
> > Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> > ---
> > arch/mips/boards/qemu-malta/init.c | 31 ++-----------------------------
> > arch/mips/configs/qemu-malta_defconfig | 1 +
> > arch/mips/dts/qemu-malta.dts | 33 +++++++++++++++++++++++++++++++++
> > 3 files changed, 36 insertions(+), 29 deletions(-)
> >
> > diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
> > index ddc90dc..4d12495 100644
> > --- a/arch/mips/boards/qemu-malta/init.c
> > +++ b/arch/mips/boards/qemu-malta/init.c
> > @@ -17,39 +17,12 @@
> > */
> >
> > #include <common.h>
> > -#include <types.h>
> > -#include <driver.h>
> > #include <init.h>
> > -#include <ns16550.h>
> > -#include <mach/hardware.h>
> > -#include <partition.h>
> > -#include <sizes.h>
> >
> > -static int malta_devices_init(void)
> > +static int malta_core_init(void)
> > {
> > - add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
> > -
> > - devfs_add_partition("nor0", 0x0, SZ_512K, DEVFS_PARTITION_FIXED, "self");
> > - devfs_add_partition("nor0", SZ_512K, SZ_64K, DEVFS_PARTITION_FIXED, "env0");
> > -
> > - return 0;
> > -}
> > -device_initcall(malta_devices_init);
> > -
> > -static struct NS16550_plat serial_plat = {
> > - .clock = 1843200, /* no matter for emulated port */
> > - .shift = 0,
> > -};
> > -
> > -static int malta_console_init(void)
> > -{
> > - barebox_set_model("qemu malta");
> > barebox_set_hostname("malta");
> >
>
> May be it is reasonable to add hostname support to dts?
>
> The lonely barebox_set_hostname() in the malta board code looks very pathetically :)
we could use the model propertie for this
Best Regards,
J.
_______________________________________________
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] MIPS: qemu-malta: switch to devicetree
2013-09-03 11:21 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-04 6:30 ` Sascha Hauer
2013-09-04 7:59 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2013-09-04 6:30 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Tue, Sep 03, 2013 at 01:21:56PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:41 Tue 03 Sep , Antony Pavlov wrote:
> > On Tue, 3 Sep 2013 08:33:33 +0400
> > > -static struct NS16550_plat serial_plat = {
> > > - .clock = 1843200, /* no matter for emulated port */
> > > - .shift = 0,
> > > -};
> > > -
> > > -static int malta_console_init(void)
> > > -{
> > > - barebox_set_model("qemu malta");
> > > barebox_set_hostname("malta");
> > >
> >
> > May be it is reasonable to add hostname support to dts?
> >
> > The lonely barebox_set_hostname() in the malta board code looks very pathetically :)
>
> we could use the model propertie for this
The model property is already used for the verbose name of a board. I
described it as:
/*
* The model is the verbose name of a board. It can contain
* whitespaces, uppercase/lowcer letters, digits, ',', '.'
* '-', '_'
*/
Whereas the hostname is without whitespaces, I described it as:
/*
* The hostname is supposed to be the shortname of a board. It should
* contain only lowercase letters, numbers, '-', '_'. No whitespaces
* allowed.
*/
I think it is reasonable to add a hostname property to the devicetree.
The last time I thought about this I couldn't really agree with myself
how to name it.
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] MIPS: qemu-malta: switch to devicetree
2013-09-04 6:30 ` Sascha Hauer
@ 2013-09-04 7:59 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 20:36 ` Sascha Hauer
0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-04 7:59 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 08:30 Wed 04 Sep , Sascha Hauer wrote:
> On Tue, Sep 03, 2013 at 01:21:56PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 08:41 Tue 03 Sep , Antony Pavlov wrote:
> > > On Tue, 3 Sep 2013 08:33:33 +0400
> > > > -static struct NS16550_plat serial_plat = {
> > > > - .clock = 1843200, /* no matter for emulated port */
> > > > - .shift = 0,
> > > > -};
> > > > -
> > > > -static int malta_console_init(void)
> > > > -{
> > > > - barebox_set_model("qemu malta");
> > > > barebox_set_hostname("malta");
> > > >
> > >
> > > May be it is reasonable to add hostname support to dts?
> > >
> > > The lonely barebox_set_hostname() in the malta board code looks very pathetically :)
> >
> > we could use the model propertie for this
>
> The model property is already used for the verbose name of a board. I
> described it as:
>
> /*
> * The model is the verbose name of a board. It can contain
> * whitespaces, uppercase/lowcer letters, digits, ',', '.'
> * '-', '_'
> */
>
> Whereas the hostname is without whitespaces, I described it as:
>
> /*
> * The hostname is supposed to be the shortname of a board. It should
> * contain only lowercase letters, numbers, '-', '_'. No whitespaces
> * allowed.
> */
>
> I think it is reasonable to add a hostname property to the devicetree.
> The last time I thought about this I couldn't really agree with myself
> how to name it.
how about use the compatible property?
for me I'll just put
model = "toto toto toto" , "toto_toot_toto";
if no second string create a hotname on the fly by replace the forbidden char
by '_'
Best Regards,
J.
_______________________________________________
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] MIPS: qemu-malta: switch to devicetree
2013-09-04 7:59 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-04 20:36 ` Sascha Hauer
0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-09-04 20:36 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Wed, Sep 04, 2013 at 09:59:19AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> how about use the compatible property?
>
> for me I'll just put
> model = "toto toto toto" , "toto_toot_toto";
>
> if no second string create a hotname on the fly by replace the forbidden char
> by '_'
That would be fine aswell. We should probably suggest something on the
devicetree discuss list.
BTW according to EPAPR the model property should be "vendor,model". Most
ARM dts don't have this layout anyway. Maybe this increases the
motivation to change something there.
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] MIPS: qemu-malta: switch to devicetree
2013-09-03 4:33 [PATCH] MIPS: qemu-malta: switch to devicetree Antony Pavlov
2013-09-03 4:41 ` Antony Pavlov
@ 2013-09-04 6:33 ` Sascha Hauer
1 sibling, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2013-09-04 6:33 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Tue, Sep 03, 2013 at 08:33:33AM +0400, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Applied, thanks
Sascha
> ---
> arch/mips/boards/qemu-malta/init.c | 31 ++-----------------------------
> arch/mips/configs/qemu-malta_defconfig | 1 +
> arch/mips/dts/qemu-malta.dts | 33 +++++++++++++++++++++++++++++++++
> 3 files changed, 36 insertions(+), 29 deletions(-)
>
> diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
> index ddc90dc..4d12495 100644
> --- a/arch/mips/boards/qemu-malta/init.c
> +++ b/arch/mips/boards/qemu-malta/init.c
> @@ -17,39 +17,12 @@
> */
>
> #include <common.h>
> -#include <types.h>
> -#include <driver.h>
> #include <init.h>
> -#include <ns16550.h>
> -#include <mach/hardware.h>
> -#include <partition.h>
> -#include <sizes.h>
>
> -static int malta_devices_init(void)
> +static int malta_core_init(void)
> {
> - add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
> -
> - devfs_add_partition("nor0", 0x0, SZ_512K, DEVFS_PARTITION_FIXED, "self");
> - devfs_add_partition("nor0", SZ_512K, SZ_64K, DEVFS_PARTITION_FIXED, "env0");
> -
> - return 0;
> -}
> -device_initcall(malta_devices_init);
> -
> -static struct NS16550_plat serial_plat = {
> - .clock = 1843200, /* no matter for emulated port */
> - .shift = 0,
> -};
> -
> -static int malta_console_init(void)
> -{
> - barebox_set_model("qemu malta");
> barebox_set_hostname("malta");
>
> - /* Register the serial port */
> - add_ns16550_device(DEVICE_ID_DYNAMIC, MALTA_PIIX4_UART0, 8,
> - IORESOURCE_MEM_8BIT, &serial_plat);
> -
> return 0;
> }
> -console_initcall(malta_console_init);
> +core_initcall(malta_core_init);
> diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
> index 18c840d..1b9ee9a 100644
> --- a/arch/mips/configs/qemu-malta_defconfig
> +++ b/arch/mips/configs/qemu-malta_defconfig
> @@ -54,6 +54,7 @@ CONFIG_NET_PING=y
> CONFIG_NET_NETCONSOLE=y
> CONFIG_NET_RESOLV=y
> CONFIG_OFDEVICE=y
> +CONFIG_OF_BAREBOX_DRIVERS=y
> # CONFIG_SPI is not set
> CONFIG_MTD=y
> CONFIG_DRIVER_CFI=y
> diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
> index c4dcf05..4057729 100644
> --- a/arch/mips/dts/qemu-malta.dts
> +++ b/arch/mips/dts/qemu-malta.dts
> @@ -6,7 +6,40 @@
> model = "qemu malta";
> compatible = "qemu,malta";
>
> + chosen {
> + environment@0 {
> + compatible = "barebox,environment";
> + device-path = &nor0, "partname:barebox-environment";
> + };
> + };
> +
> memory {
> reg = <0x00000000 0x10000000>;
> };
> +
> + uart0: serial@b00003f8 {
> + compatible = "ns16550a";
> + reg = <0xb00003f8 0x08>;
> + reg-shift = <0>;
> + /* no matter for emulated port */
> + clock-frequency = <1843200>;
> + };
> +
> + nor0: flash@be000000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "cfi-flash";
> + reg = <0xbe000000 0x00400000>;
> +
> + partition@0 {
> + label = "barebox";
> + reg = <0 0x80000>;
> + read-only;
> + };
> +
> + partition@80000 {
> + label = "barebox-environment";
> + reg = <0x80000 0x10000>;
> + };
> + };
> };
> --
> 1.8.4.rc3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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:[~2013-09-04 20:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03 4:33 [PATCH] MIPS: qemu-malta: switch to devicetree Antony Pavlov
2013-09-03 4:41 ` Antony Pavlov
2013-09-03 11:21 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 6:30 ` Sascha Hauer
2013-09-04 7:59 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 20:36 ` Sascha Hauer
2013-09-04 6:33 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox