[U-Boot] [PATCH v2 00/17] rockchip: ram: add common code for sdram driver

Kever Yang kever.yang at rock-chips.com
Fri Oct 25 01:33:47 UTC 2019


The sdram drivers for Rockchip SoCs was all separate, some of the SoCs
has similar hardware controller and phy, so we have a change to share
the flow and some of the functions between different SoCs.
This patch set implement a first version common code based on PX30,
other SoCs has similar hardware can migrate to this common code, eg.
rk3328 and rk3399 can use this common code.

This patch set also fix some bug for rk3399 by sync code from latest
rockchip vendor code.


Changes in v2:
- Split the patches into multi smaller patches for easy to maintain,
review and test;
- Keep the DRAM_ROCKCHIP_DEBUG macro and enable it by default;
- Update the rockchip_sdram_size to support sys_reg3;

Kever Yang (13):
  ram: rockchip: rename sdram.h to sdram_rk3288.h
  ram: rockchip: rename sdram_common.c/h to sdram.c
  rockchip: sdram: move cap structure and debug function to
    sdram_common.h
  rockchip: sdram: extend to use sys_reg3 for capacity info
  rockchip: sdram: update the sys_reg to sys_reg2
  ram: rockchip: add common code for sdram driver
  ram: rockchip: move sdram_debug function into sdram_common
  ram: rockchip: add controller code for PX30
  ram: rockchip: add phy driver code for PX30
  ram: rockchip: add common msch reg definition
  ram: rockchip: update lpddr4 timing for rk3399
  ram: rk3399: Sync the io setting from Rockchip vendor code
  ram: rk3399: update calculate_stride

YouMin Chen (4):
  ram: px30: add sdram driver
  ram: rk3328: use common sdram driver
  ram: rk3399: use common sdram driver
  ram: rk3399: Sync code from rockchip vendor code

 arch/arm/dts/rk3328-sdram-ddr3-666.dtsi       |    4 +
 arch/arm/dts/rk3328-sdram-lpddr3-1600.dtsi    |    4 +
 arch/arm/dts/rk3328-sdram-lpddr3-666.dtsi     |    4 +
 arch/arm/dts/rk3399-sdram-ddr3-1333.dtsi      |    4 +
 arch/arm/dts/rk3399-sdram-ddr3-1600.dtsi      |    4 +
 arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi      |    4 +
 .../arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi |    4 +
 .../arm/dts/rk3399-sdram-lpddr3-4GB-1600.dtsi |    4 +
 .../rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi |    4 +
 arch/arm/dts/rk3399-sdram-lpddr4-100.dtsi     |    4 +
 arch/arm/include/asm/arch-rockchip/sdram.h    |  168 ++-
 .../include/asm/arch-rockchip/sdram_common.h  |  116 +-
 .../include/asm/arch-rockchip/sdram_msch.h    |   85 ++
 .../asm/arch-rockchip/sdram_pctl_px30.h       |  139 ++
 .../asm/arch-rockchip/sdram_phy_px30.h        |   62 +
 .../arch-rockchip/sdram_phy_ron_rtt_px30.h    |   59 +
 .../include/asm/arch-rockchip/sdram_px30.h    |  212 +++
 .../include/asm/arch-rockchip/sdram_rk3288.h  |  102 ++
 .../include/asm/arch-rockchip/sdram_rk3328.h  |  420 ++----
 .../include/asm/arch-rockchip/sdram_rk3399.h  |   98 +-
 arch/arm/mach-rockchip/Kconfig                |    2 +
 arch/arm/mach-rockchip/Makefile               |    2 +-
 arch/arm/mach-rockchip/rk3036/rk3036.c        |    2 +-
 arch/arm/mach-rockchip/rk3288/rk3288.c        |    2 +-
 .../mach-rockchip/{sdram_common.c => sdram.c} |   85 +-
 arch/arm/mach-rockchip/spl.c                  |    1 -
 configs/evb-rk3328_defconfig                  |    2 +-
 configs/rock64-rk3328_defconfig               |    2 +-
 drivers/ram/rockchip/Kconfig                  |   23 +-
 drivers/ram/rockchip/Makefile                 |    7 +-
 drivers/ram/rockchip/dmc-rk3368.c             |    2 +-
 .../rockchip/sdram-px30-ddr3-detect-333.inc   |   72 +
 .../rockchip/sdram-px30-ddr4-detect-333.inc   |   75 +
 drivers/ram/rockchip/sdram-px30-ddr_skew.inc  |  121 ++
 .../rockchip/sdram-px30-lpddr2-detect-333.inc |   73 +
 .../rockchip/sdram-px30-lpddr3-detect-333.inc |   74 +
 .../ram/rockchip/sdram-rk3399-lpddr4-400.inc  |   28 +-
 .../ram/rockchip/sdram-rk3399-lpddr4-800.inc  |   28 +-
 drivers/ram/rockchip/sdram_common.c           |  429 ++++++
 drivers/ram/rockchip/sdram_debug.c            |    2 +-
 drivers/ram/rockchip/sdram_pctl_px30.c        |  205 +++
 drivers/ram/rockchip/sdram_phy_px30.c         |  205 +++
 drivers/ram/rockchip/sdram_px30.c             |  669 +++++++++
 drivers/ram/rockchip/sdram_rk3128.c           |    2 +-
 drivers/ram/rockchip/sdram_rk3188.c           |    2 +-
 drivers/ram/rockchip/sdram_rk322x.c           |    2 +-
 drivers/ram/rockchip/sdram_rk3288.c           |    2 +-
 drivers/ram/rockchip/sdram_rk3328.c           |  765 +++--------
 drivers/ram/rockchip/sdram_rk3399.c           | 1213 +++++++++++------
 49 files changed, 4040 insertions(+), 1558 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_msch.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_pctl_px30.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_phy_px30.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_phy_ron_rtt_px30.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_px30.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk3288.h
 rename arch/arm/mach-rockchip/{sdram_common.c => sdram.c} (60%)
 create mode 100644 drivers/ram/rockchip/sdram-px30-ddr3-detect-333.inc
 create mode 100644 drivers/ram/rockchip/sdram-px30-ddr4-detect-333.inc
 create mode 100644 drivers/ram/rockchip/sdram-px30-ddr_skew.inc
 create mode 100644 drivers/ram/rockchip/sdram-px30-lpddr2-detect-333.inc
 create mode 100644 drivers/ram/rockchip/sdram-px30-lpddr3-detect-333.inc
 create mode 100644 drivers/ram/rockchip/sdram_common.c
 create mode 100644 drivers/ram/rockchip/sdram_pctl_px30.c
 create mode 100644 drivers/ram/rockchip/sdram_phy_px30.c
 create mode 100644 drivers/ram/rockchip/sdram_px30.c

-- 
2.17.1



More information about the U-Boot mailing list