Skip to contentSkip to conversation

ARM: EXYNOS5: Add gscalar device from DT

PATCH AMEER BASHA SHAIK 2 participants 2 messages Jul 11, 2012 Arm Samsung Exynos

lore
Share & tools
lore
#0 lore raw

Hi Sylwester,

Quoted 4 lines · Sylwester Nawrocki

Hi Shaik,

Quoted 9 lines
Quoted 2 lines · Shaik Ameer Basha

Adding all 4 gscalar devices from DT device list in machine file.

nit: s/gscalar/gscaler

The above sentence doesn't quite parse though.

OK. I will fix it.

Quoted 19 lines
Quoted 19 lines
---
  arch/arm/boot/dts/exynos5250.dtsi      |   31
+++++++++++++++++++++++++++++++
  arch/arm/mach-exynos/mach-exynos5-dt.c |    8 ++++++++
  2 files changed, 39 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5250.dtsi +0 -0
index 4272b29..b945c00 100644
@@ -23,6 +23,13 @@
        compatible = "samsung,exynos5250";
        interrupt-parent =<&gic>;
 
Quoted 10 lines

arch/arm/boot/dts/exynos5250.dtsi line 32

Quoted 7 lines
arch/arm/boot/dts/exynos5250.dtsi +7 -0
+       aliases {
+               gsc0 =&gsc_0;
+               gsc1 =&gsc_1;
+               gsc2 =&gsc_2;
+               gsc3 =&gsc_3;
+       };
+

What are these aliases useful for ?

GScaler driver uses the "of_alias_get_id()" call to retrieve the device IDs, which internally uses these aliases...

Quoted 3 lines

Also I think all DT related patches should be posted to [email protected] as well.

I will post the v2 version of this patch to the specified mailing list.

Quoted 59 lines
Quoted 46 lines
arch/arm/boot/dts/exynos5250.dtsi +24 -0
        gic:interrupt-controller@10481000 {
                compatible = "arm,cortex-a9-gic";
                #interrupt-cells =<3>;
@@ -424,4 +431,28 @@
                        #gpio-cells =<4>;
                };
        };
+
+       gsc_0:  gsc@0x13e00000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e00000 0x1000>;
+               interrupts =<0 85 0>;
+       };
+
+       gsc_1:  gsc@0x13e10000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e10000 0x1000>;
+               interrupts =<0 86 0>;
+       };
+
+       gsc_2:  gsc@0x13e20000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e20000 0x1000>;
+               interrupts =<0 87 0>;
+       };
+
+       gsc_3:  gsc@0x13e30000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e30000 0x1000>;
+               interrupts =<0 88 0>;
+       };
  };
arch/arm/mach-exynos/mach-exynos5-dt.c +0 -0
index 7b1e11a..76b081c 100644
@@ -50,6 +50,14 @@ static const struct of_dev_auxdata
 exynos5250_auxdata_lookup[] __initconst = {
        OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0",
 NULL),
        OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1",
 NULL),
        OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2",

NULL),

arch/arm/mach-exynos/mach-exynos5-dt.c

Quoted 8 lines
arch/arm/mach-exynos/mach-exynos5-dt.c +8 -0
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E00000,
+                               "exynos-gsc.0", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E10000,
+                               "exynos-gsc.1", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E20000,
+                               "exynos-gsc.2", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E30000,
+                               "exynos-gsc.3", NULL),

It's probably better to add relevant entry at arch/arm/mach-exynos/include/mach/map. It's just a one line, e.g.

Quoted 4 lines

/* x = 0...3 */
#define EXYNOS5_PA_GSC(x) (0x13e00000 + ((x) * 0x10000))

And use it here instead of plain numbers.

OK. will address these comments in v2.

Quoted 4 lines

--
Thanks,
Sylwester

Regards,
Shaik Ameer Basha

#1 lore raw

Hi Shaik,

Quoted 20 lines · AMEER BASHA SHAIK
Quoted 9 lines
Quoted 9 lines
arch/arm/boot/dts/exynos5250.dtsi +0 -0
index 4272b29..b945c00 100644
@@ -23,6 +23,13 @@
         compatible = "samsung,exynos5250";
         interrupt-parent =<&gic>;
 
Quoted 10 lines

arch/arm/boot/dts/exynos5250.dtsi line 32

Quoted 7 lines
arch/arm/boot/dts/exynos5250.dtsi +7 -0
+       aliases {
+               gsc0 =&gsc_0;
+               gsc1 =&gsc_1;
+               gsc2 =&gsc_2;
+               gsc3 =&gsc_3;
+       };
+

What are these aliases useful for ?

Quoted 2 lines

GScaler driver uses the "of_alias_get_id()" call to retrieve the device IDs, which internally uses these aliases...

Yeah, just figured it out already... I didn't know then it was a preferred way to represent device IDs in DT. I looked at the driver's code and it seemed slightly incorrect to me. Let me comment on the relevant patch shortly.

Would be good to have things like this documented in the GScaler bindings documentation. These aliases seem quite essential for the driver to work.

Quoted 65 lines
Quoted 3 lines

Also I think all DT related patches should be posted to [email protected] as well.

I will post the v2 version of this patch to the specified mailing list.

Quoted 59 lines
Quoted 46 lines
arch/arm/boot/dts/exynos5250.dtsi +24 -0
         gic:interrupt-controller@10481000 {
                 compatible = "arm,cortex-a9-gic";
                 #interrupt-cells =<3>;
@@ -424,4 +431,28 @@
                         #gpio-cells =<4>;
                 };
         };
+
+       gsc_0:  gsc@0x13e00000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e00000 0x1000>;
+               interrupts =<0 85 0>;
+       };
+
+       gsc_1:  gsc@0x13e10000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e10000 0x1000>;
+               interrupts =<0 86 0>;
+       };
+
+       gsc_2:  gsc@0x13e20000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e20000 0x1000>;
+               interrupts =<0 87 0>;
+       };
+
+       gsc_3:  gsc@0x13e30000 {
+               compatible = "samsung,exynos-gsc";
+               reg =<0x13e30000 0x1000>;
+               interrupts =<0 88 0>;
+       };
   };
arch/arm/mach-exynos/mach-exynos5-dt.c +0 -0
index 7b1e11a..76b081c 100644
@@ -50,6 +50,14 @@ static const struct of_dev_auxdata
 exynos5250_auxdata_lookup[] __initconst = {
         OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0",
 NULL),
         OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1",
 NULL),
         OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2",

NULL),

arch/arm/mach-exynos/mach-exynos5-dt.c

Quoted 8 lines
arch/arm/mach-exynos/mach-exynos5-dt.c +8 -0
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E00000,
+                               "exynos-gsc.0", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E10000,
+                               "exynos-gsc.1", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E20000,
+                               "exynos-gsc.2", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-gsc", 0x13E30000,
+                               "exynos-gsc.3", NULL),

It's probably better to add relevant entry at arch/arm/mach-exynos/include/mach/map. It's just a one line, e.g.

Quoted 6 lines
Quoted 4 lines

/* x = 0...3 */
#define EXYNOS5_PA_GSC(x) (0x13e00000 + ((x) * 0x10000))

And use it here instead of plain numbers.

OK. will address these comments in v2.

Thanks.

--
Regards,
Sylwester