diff mbox

[2/4] ARM: sirf: add atlas7 machine support

Message ID 1419496460-4929-3-git-send-email-21cnbao@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Barry Song Dec. 25, 2014, 8:34 a.m. UTC
From: Zhiwu Song <Zhiwu.Song@csr.com>

atlas7 is next-gen auto soc from CSR.
It could bring to customers most integrated SoC solution:
- World leading Bluetooth 4.0 and GNSS baseband
- Audio processing, analog CODEC and ADC
- Analog video input
- SDR accelerators

Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 Documentation/devicetree/bindings/arm/sirf.txt |  2 ++
 arch/arm/mach-prima2/Kconfig                   | 13 ++++++++++++-
 arch/arm/mach-prima2/common.c                  | 15 +++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)

Comments

Arnd Bergmann Dec. 30, 2014, 10:34 p.m. UTC | #1
On Thursday 25 December 2014 16:34:18 Barry Song wrote:
> +DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
> +       /* Maintainer: Barry Song <baohua.song@csr.com> */
> +       .smp            = smp_ops(sirfsoc_smp_ops),
> +       .map_io         = sirfsoc_map_io,
> +       .init_late      = sirfsoc_init_late,
> +       .dt_compat      = atlas7_dt_match,
> +MACHINE_END

Can you check if the sirfsoc_map_io function is still required?
My guess is that you can just replace sirfsoc_map_scu() with a
call of ioremap in sirfsoc_smp_prepare_cpus, and drop sirfsoc_map_lluart()
entirely in favor of the default debug_ll_io_init() function that
is called when map_io is NULL.

Also, how about merging the entries for atlas6 and atlas7, and just
having multiple compatible strings in atlas_dt_match?

	Arnd
Barry Song Dec. 31, 2014, 2:50 p.m. UTC | #2
2014-12-31 6:34 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Thursday 25 December 2014 16:34:18 Barry Song wrote:
>> +DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
>> +       /* Maintainer: Barry Song <baohua.song@csr.com> */
>> +       .smp            = smp_ops(sirfsoc_smp_ops),
>> +       .map_io         = sirfsoc_map_io,
>> +       .init_late      = sirfsoc_init_late,
>> +       .dt_compat      = atlas7_dt_match,
>> +MACHINE_END
>
> Can you check if the sirfsoc_map_io function is still required?
> My guess is that you can just replace sirfsoc_map_scu() with a
> call of ioremap in sirfsoc_smp_prepare_cpus, and drop sirfsoc_map_lluart()
> entirely in favor of the default debug_ll_io_init() function that
> is called when map_io is NULL.
>
> Also, how about merging the entries for atlas6 and atlas7, and just
> having multiple compatible strings in atlas_dt_match?

the situation is that atlas7 is not a family of atlas6. atlas6 is much
similar with prima2, but atlas7 is actually a replacement of earlier
marco family.

atlas7 is a dual core cortex-a7, but atlas6 is a single core
cortex-a9. and atlas7 is using a Network on Chip(NoC) bus architecture
which is completely not same with atlas6 which is using a tree-type
bus, so atlas7 will have some machine-specific codes like NoC fireware
which should be in machine specific codes to handle external data
aborts things for security protection. and more important, atlas7 has
much different IP modules with atlas6 for things like GPS,
connectiviy, software digital radios. and atlas7 has a more cortex-M3
for CAN stack, so this will involve some IPC drivers. and one more DSP
for audio processing.

this means atlas7 is not a simple atlas6+1, it is a new chip.  i have
a feeling atlas7 should be highlighted as a seperate machine.

>
>         Arnd

-barry
Arnd Bergmann Jan. 2, 2015, 9 a.m. UTC | #3
On Wednesday 31 December 2014 22:50:16 Barry Song wrote:
> 2014-12-31 6:34 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> > On Thursday 25 December 2014 16:34:18 Barry Song wrote:
> >> +DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
> >> +       /* Maintainer: Barry Song <baohua.song@csr.com> */
> >> +       .smp            = smp_ops(sirfsoc_smp_ops),
> >> +       .map_io         = sirfsoc_map_io,
> >> +       .init_late      = sirfsoc_init_late,
> >> +       .dt_compat      = atlas7_dt_match,
> >> +MACHINE_END
> >
> > Can you check if the sirfsoc_map_io function is still required?
> > My guess is that you can just replace sirfsoc_map_scu() with a
> > call of ioremap in sirfsoc_smp_prepare_cpus, and drop sirfsoc_map_lluart()
> > entirely in favor of the default debug_ll_io_init() function that
> > is called when map_io is NULL.
> >
> > Also, how about merging the entries for atlas6 and atlas7, and just
> > having multiple compatible strings in atlas_dt_match?
> 
> the situation is that atlas7 is not a family of atlas6. atlas6 is much
> similar with prima2, but atlas7 is actually a replacement of earlier
> marco family.
> 
> atlas7 is a dual core cortex-a7, but atlas6 is a single core
> cortex-a9. and atlas7 is using a Network on Chip(NoC) bus architecture
> which is completely not same with atlas6 which is using a tree-type
> bus, so atlas7 will have some machine-specific codes like NoC fireware
> which should be in machine specific codes to handle external data
> aborts things for security protection. and more important, atlas7 has
> much different IP modules with atlas6 for things like GPS,
> connectiviy, software digital radios. and atlas7 has a more cortex-M3
> for CAN stack, so this will involve some IPC drivers. and one more DSP
> for audio processing.
> 
> this means atlas7 is not a simple atlas6+1, it is a new chip.  i have
> a feeling atlas7 should be highlighted as a seperate machine.

Ideally, I'd like to see a single DT_MACHINE_START for all of the
sirf machines once you have eliminated all the callbacks, but
until then, using one per SoC type for consistency is fine with me
as well, so just leave it that way for now.

	Arnd
Barry Song Jan. 4, 2015, 7:23 a.m. UTC | #4
2014-12-31 6:34 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Thursday 25 December 2014 16:34:18 Barry Song wrote:
>> +DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
>> +       /* Maintainer: Barry Song <baohua.song@csr.com> */
>> +       .smp            = smp_ops(sirfsoc_smp_ops),
>> +       .map_io         = sirfsoc_map_io,
>> +       .init_late      = sirfsoc_init_late,
>> +       .dt_compat      = atlas7_dt_match,
>> +MACHINE_END
>
> Can you check if the sirfsoc_map_io function is still required?
> My guess is that you can just replace sirfsoc_map_scu() with a
> call of ioremap in sirfsoc_smp_prepare_cpus, and drop sirfsoc_map_lluart()
> entirely in favor of the default debug_ll_io_init() function that
> is called when map_io is NULL.

after dropping MARCO,  i can simply delete sirfsoc_map_scu() as for
atlas7, this is not needed any more.
then finally, i can delete all sirfsoc_map_io() and DEBUG_LL mapping.

-barry
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/arm/sirf.txt b/Documentation/devicetree/bindings/arm/sirf.txt
index c6ba6d3..018de18 100644
--- a/Documentation/devicetree/bindings/arm/sirf.txt
+++ b/Documentation/devicetree/bindings/arm/sirf.txt
@@ -3,7 +3,9 @@  CSR SiRFprimaII and SiRFmarco device tree bindings.
 
 Required root node properties:
     - compatible:
+    - "sirf,atlas7-cb" : atlas7 device based board
     - "sirf,prima2-cb" : prima2 "cb" evaluation board
     - "sirf,marco-cb" : marco "cb" evaluation board
+    - "sirf,atlas7" : atlas7 device based board
     - "sirf,prima2" : prima2 device based board
     - "sirf,marco" : marco device based board
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 042f693..e8f17c9 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -11,7 +11,7 @@  menuconfig ARCH_SIRF
 
 if ARCH_SIRF
 
-comment "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
+comment "CSR SiRF atlas6/primaII/Marco/Atlas7 Specific Features"
 
 config ARCH_ATLAS6
 	bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
@@ -20,6 +20,17 @@  config ARCH_ATLAS6
 	help
           Support for CSR SiRFSoC ARM Cortex A9 Platform
 
+config ARCH_ATLAS7
+	bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform"
+	default y
+	select ARM_GIC
+	select CPU_V7
+	select HAVE_ARM_SCU if SMP
+	select HAVE_SMP
+	select SMP_ON_UP if SMP
+	help
+          Support for CSR SiRFSoC ARM Cortex A7 Platform
+
 config ARCH_PRIMA2
 	bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
 	default y
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index a860ea2..2f45d48 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -75,3 +75,18 @@  DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
 	.dt_compat      = marco_dt_match,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_ARCH_ATLAS7
+static const char *atlas7_dt_match[] __initdata = {
+	"sirf,atlas7",
+	NULL
+};
+
+DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
+	/* Maintainer: Barry Song <baohua.song@csr.com> */
+	.smp            = smp_ops(sirfsoc_smp_ops),
+	.map_io         = sirfsoc_map_io,
+	.init_late	= sirfsoc_init_late,
+	.dt_compat      = atlas7_dt_match,
+MACHINE_END
+#endif