* [PATCH] openrisc: move ethoc registration to device_initcall
@ 2014-05-10 22:42 Franck Jullien
2014-05-12 4:40 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Franck Jullien @ 2014-05-10 22:42 UTC (permalink / raw)
To: barebox
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
arch/openrisc/boards/generic/generic.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/openrisc/boards/generic/generic.c b/arch/openrisc/boards/generic/generic.c
index 9f68007..5c1698d 100644
--- a/arch/openrisc/boards/generic/generic.c
+++ b/arch/openrisc/boards/generic/generic.c
@@ -9,6 +9,18 @@ static struct NS16550_plat serial_plat = {
.shift = 0,
};
+static int openrisc_devices_init(void)
+{
+#ifdef CONFIG_DRIVER_NET_ETHOC
+ add_generic_device("ethoc", DEVICE_ID_DYNAMIC, NULL,
+ OPENRISC_SOPC_ETHOC_BASE, 0x1000,
+ IORESOURCE_MEM, NULL);
+#endif
+ return 0;
+}
+
+device_initcall(openrisc_devices_init);
+
static int openrisc_console_init(void)
{
barebox_set_model("OpenRISC or1k");
@@ -18,12 +30,6 @@ static int openrisc_console_init(void)
add_ns16550_device(DEVICE_ID_DYNAMIC, OPENRISC_SOPC_UART_BASE, 1024,
IORESOURCE_MEM | IORESOURCE_MEM_8BIT, &serial_plat);
-#ifdef CONFIG_DRIVER_NET_ETHOC
- add_generic_device("ethoc", DEVICE_ID_DYNAMIC, NULL,
- OPENRISC_SOPC_ETHOC_BASE, 0x1000,
- IORESOURCE_MEM, NULL);
-#endif
-
return 0;
}
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] openrisc: move ethoc registration to device_initcall
2014-05-10 22:42 [PATCH] openrisc: move ethoc registration to device_initcall Franck Jullien
@ 2014-05-12 4:40 ` Sascha Hauer
2014-05-12 7:49 ` Franck Jullien
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2014-05-12 4:40 UTC (permalink / raw)
To: Franck Jullien; +Cc: barebox
On Sun, May 11, 2014 at 12:42:04AM +0200, Franck Jullien wrote:
> Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
> ---
> arch/openrisc/boards/generic/generic.c | 18 ++++++++++++------
> 1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/openrisc/boards/generic/generic.c b/arch/openrisc/boards/generic/generic.c
> index 9f68007..5c1698d 100644
> --- a/arch/openrisc/boards/generic/generic.c
> +++ b/arch/openrisc/boards/generic/generic.c
> @@ -9,6 +9,18 @@ static struct NS16550_plat serial_plat = {
> .shift = 0,
> };
>
> +static int openrisc_devices_init(void)
> +{
> +#ifdef CONFIG_DRIVER_NET_ETHOC
> + add_generic_device("ethoc", DEVICE_ID_DYNAMIC, NULL,
> + OPENRISC_SOPC_ETHOC_BASE, 0x1000,
> + IORESOURCE_MEM, NULL);
> +#endif
> + return 0;
> +}
> +
> +device_initcall(openrisc_devices_init);
What's wrong with the original console_initcall? Does this solve any
issues?
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] 3+ messages in thread
* Re: [PATCH] openrisc: move ethoc registration to device_initcall
2014-05-12 4:40 ` Sascha Hauer
@ 2014-05-12 7:49 ` Franck Jullien
0 siblings, 0 replies; 3+ messages in thread
From: Franck Jullien @ 2014-05-12 7:49 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
2014-05-12 6:40 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> On Sun, May 11, 2014 at 12:42:04AM +0200, Franck Jullien wrote:
>> Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
>> ---
>> arch/openrisc/boards/generic/generic.c | 18 ++++++++++++------
>> 1 files changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/openrisc/boards/generic/generic.c b/arch/openrisc/boards/generic/generic.c
>> index 9f68007..5c1698d 100644
>> --- a/arch/openrisc/boards/generic/generic.c
>> +++ b/arch/openrisc/boards/generic/generic.c
>> @@ -9,6 +9,18 @@ static struct NS16550_plat serial_plat = {
>> .shift = 0,
>> };
>>
>> +static int openrisc_devices_init(void)
>> +{
>> +#ifdef CONFIG_DRIVER_NET_ETHOC
>> + add_generic_device("ethoc", DEVICE_ID_DYNAMIC, NULL,
>> + OPENRISC_SOPC_ETHOC_BASE, 0x1000,
>> + IORESOURCE_MEM, NULL);
>> +#endif
>> + return 0;
>> +}
>> +
>> +device_initcall(openrisc_devices_init);
>
> What's wrong with the original console_initcall? Does this solve any
> issues?
>
> Sascha
>
It does not solve anything. However, it can lead to errors.
As a matter of fact I have a NOR on my board so I added
add_cfi_flash_device and devfs_add_partition just above the ethoc in
the console_initcall...and it doesn't work (because it's too early in
the boot process).
Anyway, don't apply this for now has I have some problems with
ethernet and it's may be related.
Franck.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-12 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-10 22:42 [PATCH] openrisc: move ethoc registration to device_initcall Franck Jullien
2014-05-12 4:40 ` Sascha Hauer
2014-05-12 7:49 ` Franck Jullien
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox