linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine
@ 2021-03-11 19:19 Cristian Ciocaltea
  2021-03-12  8:39 ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Cristian Ciocaltea @ 2021-03-11 19:19 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam, Russell King
  Cc: linux-arm-kernel, linux-actions, linux-kernel

Add machine entry for the S500 variant of the Actions Semi Owl SoCs
family.

For the moment the only purpose is to provide the system serial
information which will be used by the Owl Ethernet MAC driver to
generate a stable MAC address.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
---
 arch/arm/mach-actions/Makefile  |  1 +
 arch/arm/mach-actions/actions.c | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 arch/arm/mach-actions/actions.c

diff --git a/arch/arm/mach-actions/Makefile b/arch/arm/mach-actions/Makefile
index 8eae9587fe82..31865c958d92 100644
--- a/arch/arm/mach-actions/Makefile
+++ b/arch/arm/mach-actions/Makefile
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
+obj-${CONFIG_ARCH_ACTIONS} += actions.o
 obj-${CONFIG_SMP} += platsmp.o
diff --git a/arch/arm/mach-actions/actions.c b/arch/arm/mach-actions/actions.c
new file mode 100644
index 000000000000..306c6bb178fe
--- /dev/null
+++ b/arch/arm/mach-actions/actions.c
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Actions Semi Owl SoCs
+ *
+ * Copyright (c) 2012 Actions Semi Inc.
+ * Copyright (c) 2021 Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
+ */
+
+#include <linux/highmem.h>
+#include <linux/of_platform.h>
+
+#include <asm/mach/arch.h>
+#include <asm/system_info.h>
+
+#define OWL_S500_SERIAL_LOW_PAGE_OFF		0x800
+#define OWL_S500_SERIAL_HIGH_PAGE_OFF		0x804
+
+static const char *const owl_s500_dt_compat[] __initconst = {
+	"actions,s500",
+	NULL,
+};
+
+static void __init owl_s500_get_system_serial(void)
+{
+	char *vddr = kmap_local_page(pfn_to_page(PFN_DOWN(0)));
+
+	memcpy(&system_serial_low, vddr + OWL_S500_SERIAL_LOW_PAGE_OFF,
+	       sizeof(system_serial_low));
+	memcpy(&system_serial_high, vddr + OWL_S500_SERIAL_HIGH_PAGE_OFF,
+	       sizeof(system_serial_high));
+
+	kunmap_local(vddr);
+}
+
+static void __init owl_s500_init_early(void)
+
+{
+	owl_s500_get_system_serial();
+}
+
+DT_MACHINE_START(ACTIONS, "Actions Semi Owl S500 SoC")
+	.dt_compat	= owl_s500_dt_compat,
+	.init_early	= owl_s500_init_early,
+MACHINE_END
-- 
2.30.2


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

* Re: [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine
  2021-03-11 19:19 [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine Cristian Ciocaltea
@ 2021-03-12  8:39 ` Andreas Färber
  2021-03-12  9:28   ` Cristian Ciocaltea
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2021-03-12  8:39 UTC (permalink / raw)
  To: Cristian Ciocaltea
  Cc: linux-arm-kernel, linux-actions, linux-kernel, Russell King,
	Manivannan Sadhasivam

Hi Cristian,

On 11.03.21 20:19, Cristian Ciocaltea wrote:
> Add machine entry for the S500 variant of the Actions Semi Owl SoCs
> family.
> 
> For the moment the only purpose is to provide the system serial
> information which will be used by the Owl Ethernet MAC driver to
> generate a stable MAC address.

Can't that be done in either a sys_soc driver or U-Boot?

Regards,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

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

* Re: [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine
  2021-03-12  8:39 ` Andreas Färber
@ 2021-03-12  9:28   ` Cristian Ciocaltea
  2021-03-19 18:33     ` Cristian Ciocaltea
  0 siblings, 1 reply; 4+ messages in thread
From: Cristian Ciocaltea @ 2021-03-12  9:28 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-arm-kernel, linux-actions, linux-kernel, Russell King,
	Manivannan Sadhasivam

Hi Andreas,

On Fri, Mar 12, 2021 at 09:39:31AM +0100, Andreas Färber wrote:
> Hi Cristian,
> 
> On 11.03.21 20:19, Cristian Ciocaltea wrote:
> > Add machine entry for the S500 variant of the Actions Semi Owl SoCs
> > family.
> > 
> > For the moment the only purpose is to provide the system serial
> > information which will be used by the Owl Ethernet MAC driver to
> > generate a stable MAC address.
> 
> Can't that be done in either a sys_soc driver or U-Boot?

I will look first at the sys_soc driver approach.

I haven't started working on the U-Boot side yet, but I'm planning to do
so as soon as possible. Last time when I checked, there was some initial
support only for the S700 and S900 SoCs, but I will do my best to add
also the S500 to the list.

Thanks,
Cristi

> Regards,
> Andreas
> 
> -- 
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer
> HRB 36809 (AG Nürnberg)

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

* Re: [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine
  2021-03-12  9:28   ` Cristian Ciocaltea
@ 2021-03-19 18:33     ` Cristian Ciocaltea
  0 siblings, 0 replies; 4+ messages in thread
From: Cristian Ciocaltea @ 2021-03-19 18:33 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-arm-kernel, linux-actions, linux-kernel, Russell King,
	Manivannan Sadhasivam

On Fri, Mar 12, 2021 at 11:28:53AM +0200, Cristian Ciocaltea wrote:
> Hi Andreas,
> 
> On Fri, Mar 12, 2021 at 09:39:31AM +0100, Andreas Färber wrote:
> > Hi Cristian,
> > 
> > On 11.03.21 20:19, Cristian Ciocaltea wrote:
> > > Add machine entry for the S500 variant of the Actions Semi Owl SoCs
> > > family.
> > > 
> > > For the moment the only purpose is to provide the system serial
> > > information which will be used by the Owl Ethernet MAC driver to
> > > generate a stable MAC address.
> > 
> > Can't that be done in either a sys_soc driver or U-Boot?
> 
> I will look first at the sys_soc driver approach.

I have just submitted a socinfo driver:

https://lore.kernel.org/lkml/cover.1616178258.git.cristian.ciocaltea@gmail.com/

Thanks,
Cristi

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

end of thread, other threads:[~2021-03-19 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 19:19 [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine Cristian Ciocaltea
2021-03-12  8:39 ` Andreas Färber
2021-03-12  9:28   ` Cristian Ciocaltea
2021-03-19 18:33     ` Cristian Ciocaltea

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).