Skip to contentSkip to conversation

rockchip: rockchip, sdram-channel 0xff fix remaining dts

PATCH New Sandy Patterson 3 participants 6 messages Jul 28, 2016 – Aug 4, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Add an extra byte so that this data is not byteswapped.

---

 arch/arm/dts/rk3288-rock2-square.dts | 2 +-
 arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk3288-rock2-square.dts +1 -1
index 34073c9..2c30355 100644
@@ -192,7 +192,7 @@
 		0x5 0x0>;
 	rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
 		0xa60 0x40 0x10 0x0>;
-	rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+	rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
 	rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
 };
 
arch/arm/dts/rk3288-veyron.dtsi +1 -1
index 421d212..d9d5187 100644
@@ -253,7 +253,7 @@
 		0x5 0x0>;
 	rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
 		0xa60 0x40 0x10 0x0>;
-	rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+	rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
 	rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
 };
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Hi Sandy,

Quoted 8 lines · Sandy Patterson

Add an extra byte so that this data is not byteswapped.

---

 arch/arm/dts/rk3288-rock2-square.dts | 2 +-
 arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Do these board use OF_PLATDATA? I thought not.

Quoted 28 lines
arch/arm/dts/rk3288-rock2-square.dts +1 -1
index 34073c9..2c30355 100644
@@ -192,7 +192,7 @@
                0x5 0x0>;
        rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
                0xa60 0x40 0x10 0x0>;
-       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
        rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
 };
 
arch/arm/dts/rk3288-veyron.dtsi +1 -2
index 421d212..d9d5187 100644
@@ -253,7 +253,7 @@
                0x5 0x0>;
        rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
                0xa60 0x40 0x10 0x0>;
-       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
        rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
 };
 
--
Quoted 2 lines

1.9.1

Regards,
Simon

#2 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Hi Simon,

Quoted 8 lines · Simon Glass

Hi Sandy,

Quoted 5 lines · Sandy Patterson

Add an extra byte so that this data is not byteswapped.

---

Quoted 6 lines
Quoted 3 lines
  arch/arm/dts/rk3288-rock2-square.dts | 2 +-
  arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Do these board use OF_PLATDATA? I thought not.

Yes, only firefly-rk3288 board use OF_PLATDATA. But driver get rk3288_sdram_channel via fdtdec_get_byte_array with the size which is sizeof(struct rk3288_sdram_channel).
In commit 9ca7e67 rockchip: Update the sdram-channel property to support of-platdata, you add dummy element in struct rk3288_sdram_channel and size was changed to 9.
Without this fix, driver get rk3288_sdram_channel failed.

Maybe add CONFIG_IS_ENABLED(OF_PLATDATA) for distinction is better, how about?

struct rk3288_sdram_channel {
     u8 rank;
     u8 col;
     u8 bk;
     u8 bw;
     u8 dbw;
     u8 row_3_4;
     u8 cs0_row;
     u8 cs1_row;

#if CONFIG_IS_ENABLED(OF_PLATDATA)
/*
* For of-platdata, which would otherwise convert this into two
* byte-swapped integers. With a size of 9 bytes, this struct will
* appear in of-platdata as a byte array.
*/
u8 dummy;
#endif
};

Quoted 35 lines
Quoted 27 lines
arch/arm/dts/rk3288-rock2-square.dts +1 -1
index 34073c9..2c30355 100644
@@ -192,7 +192,7 @@
                 0x5 0x0>;
         rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
                 0xa60 0x40 0x10 0x0>;
-       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
         rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
  };
 
arch/arm/dts/rk3288-veyron.dtsi +1 -2
index 421d212..d9d5187 100644
@@ -253,7 +253,7 @@
                 0x5 0x0>;
         rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
                 0xa60 0x40 0x10 0x0>;
-       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+       rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 0xff>;
         rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
  };
 
--
Quoted 2 lines

1.9.1

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Hi Ziyuan,

Quoted 43 lines · Ziyuan Xu

Hi Simon,

Quoted 11 lines · Simon Glass

Hi Sandy,

Quoted 6 lines · Sandy Patterson

Add an extra byte so that this data is not byteswapped.

---

Quoted 7 lines
Quoted 3 lines
  arch/arm/dts/rk3288-rock2-square.dts | 2 +-
  arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Do these board use OF_PLATDATA? I thought not.

Yes, only firefly-rk3288 board use OF_PLATDATA. But driver get rk3288_sdram_channel via fdtdec_get_byte_array with the size which is sizeof(struct rk3288_sdram_channel).
In commit 9ca7e67 rockchip: Update the sdram-channel property to support of-platdata, you add dummy element in struct rk3288_sdram_channel and size was changed to 9.
Without this fix, driver get rk3288_sdram_channel failed.

Maybe add CONFIG_IS_ENABLED(OF_PLATDATA) for distinction is better, how about?

struct rk3288_sdram_channel {
    u8 rank;
    u8 col;
    u8 bk;
    u8 bw;
    u8 dbw;
    u8 row_3_4;
    u8 cs0_row;
    u8 cs1_row;
Quoted 11 lines

#if CONFIG_IS_ENABLED(OF_PLATDATA)
/*
* For of-platdata, which would otherwise convert this into two
* byte-swapped integers. With a size of 9 bytes, this struct will
* appear in of-platdata as a byte array.
*/
u8 dummy;
#endif
};

Yes, but I'm happy with either solution. Your one may be a little easier to understand, but if someone switches a board over to OF_PLATDATA then it will be confusing... Please let me know which you prefer.

Regards,
Simon

#4 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Hi Simon,

Quoted 53 lines · Simon Glass

Hi Ziyuan,

Quoted 39 lines · Ziyuan Xu

Hi Simon,

Quoted 9 lines · Simon Glass

Hi Sandy,

Quoted 5 lines · Sandy Patterson

Add an extra byte so that this data is not byteswapped.

---

Quoted 6 lines
Quoted 3 lines
   arch/arm/dts/rk3288-rock2-square.dts | 2 +-
   arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Do these board use OF_PLATDATA? I thought not.

Yes, only firefly-rk3288 board use OF_PLATDATA. But driver get rk3288_sdram_channel via fdtdec_get_byte_array with the size which is sizeof(struct rk3288_sdram_channel).
In commit 9ca7e67 rockchip: Update the sdram-channel property to support of-platdata, you add dummy element in struct rk3288_sdram_channel and size was changed to 9.
Without this fix, driver get rk3288_sdram_channel failed.

Maybe add CONFIG_IS_ENABLED(OF_PLATDATA) for distinction is better, how about?

struct rk3288_sdram_channel {
     u8 rank;
     u8 col;
     u8 bk;
     u8 bw;
     u8 dbw;
     u8 row_3_4;
     u8 cs0_row;
     u8 cs1_row;
Quoted 11 lines

#if CONFIG_IS_ENABLED(OF_PLATDATA)
/*
* For of-platdata, which would otherwise convert this into two
* byte-swapped integers. With a size of 9 bytes, this struct will
* appear in of-platdata as a byte array.
*/
u8 dummy;
#endif
};

Quoted 4 lines

Yes, but I'm happy with either solution. Your one may be a little easier to understand, but if someone switches a board over to OF_PLATDATA then it will be confusing... Please let me know which you prefer.

OF_PLATDATA is used to reduce the size of the SPL, right? In most cases, some rk3288 boards use OF_LIBFDT. If OF_PLATDATA is really required, I think your comment is very clear.
I perfer my above opinion? :-)

Quoted 5 lines

Regards,
Simon

#5 lore raw

PATCH 1/1 rockchip: rockchip, sdram-channel 0xff fix remaining dts

Hi Ziyuan,

Quoted 70 lines · Ziyuan Xu

Hi Simon,

Quoted 60 lines · Simon Glass

Hi Ziyuan,

Quoted 45 lines · Ziyuan Xu

Hi Simon,

Quoted 11 lines · Simon Glass

Hi Sandy,

Quoted 6 lines · Sandy Patterson

Add an extra byte so that this data is not byteswapped.

---

Quoted 7 lines
Quoted 3 lines
   arch/arm/dts/rk3288-rock2-square.dts | 2 +-
   arch/arm/dts/rk3288-veyron.dtsi      | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Do these board use OF_PLATDATA? I thought not.

Yes, only firefly-rk3288 board use OF_PLATDATA. But driver get rk3288_sdram_channel via fdtdec_get_byte_array with the size which is sizeof(struct rk3288_sdram_channel).
In commit 9ca7e67 rockchip: Update the sdram-channel property to support of-platdata, you add dummy element in struct rk3288_sdram_channel and size
was changed to 9.
Without this fix, driver get rk3288_sdram_channel failed.

Maybe add CONFIG_IS_ENABLED(OF_PLATDATA) for distinction is better, how about?

struct rk3288_sdram_channel {
     u8 rank;
     u8 col;
     u8 bk;
     u8 bw;
     u8 dbw;
     u8 row_3_4;
     u8 cs0_row;
     u8 cs1_row;
Quoted 11 lines

#if CONFIG_IS_ENABLED(OF_PLATDATA)
/*
* For of-platdata, which would otherwise convert this into two
* byte-swapped integers. With a size of 9 bytes, this struct will
* appear in of-platdata as a byte array.
*/
u8 dummy;
#endif
};

Quoted 4 lines

Yes, but I'm happy with either solution. Your one may be a little easier to understand, but if someone switches a board over to OF_PLATDATA then it will be confusing... Please let me know which you prefer.

Quoted 4 lines

OF_PLATDATA is used to reduce the size of the SPL, right? In most cases, some rk3288 boards use OF_LIBFDT. If OF_PLATDATA is really required, I think your comment is very clear.
I perfer my above opinion? :-)

I'm going to apply this patch, but please feel free to send a patch to change this over if you wish.

Applied to u-boot-rockchip, thanks!