[U-Boot] [PATCH 0/7] rockchip: Split sdram common function into sdram_common.c

Andy Yan andy.yan at rock-chips.com
Thu Jun 15 07:41:47 UTC 2017


Hi Kever:


On 2017年06月13日 17:29, Kever Yang wrote:
> Some function like the dram capability decode and dram_init() are
> the same for all Rockchip SoCs, maybe alaso cap detect function later,
> add sdram_common.c for all SoC driver.
>
>
>
> Kever Yang (7):
>    rockchip: add sdram_common for common functions
>    rockchip: use common sdram function
>    rockchip: rk3328: add sdram driver in U-Boot
>    rockchip: rk3368: add sdram driver for U-Boot
>    rockchip: dts: rk3328: add dmc node
>    rockchip: dts: rk3368: add dmc node
>    rockchip: correct the bank0 ram size
>
>   arch/arm/dts/rk3328.dtsi                          |  7 ++
>   arch/arm/dts/rk3368.dtsi                          |  7 ++
>   arch/arm/include/asm/arch-rockchip/ddr_rk3288.h   | 48 -----------
>   arch/arm/include/asm/arch-rockchip/grf_rk3368.h   |  4 +-
>   arch/arm/include/asm/arch-rockchip/sdram_common.h | 58 ++++++++++++++
>   arch/arm/mach-rockchip/Makefile                   |  3 +
>   arch/arm/mach-rockchip/rk3188-board.c             | 22 -----
>   arch/arm/mach-rockchip/rk3188/sdram_rk3188.c      | 61 +++-----------
>   arch/arm/mach-rockchip/rk3288-board.c             | 22 -----
>   arch/arm/mach-rockchip/rk3288/sdram_rk3288.c      | 74 +++++------------
>   arch/arm/mach-rockchip/rk3328/Makefile            |  1 +
>   arch/arm/mach-rockchip/rk3328/sdram_rk3328.c      | 66 +++++++++++++++
>   arch/arm/mach-rockchip/rk3368/Makefile            |  1 +
>   arch/arm/mach-rockchip/rk3368/sdram_rk3368.c      | 66 +++++++++++++++
>   arch/arm/mach-rockchip/rk3399/sdram_rk3399.c      | 97 ++---------------------
>   arch/arm/mach-rockchip/sdram_common.c             | 71 +++++++++++++++++
>   board/rockchip/evb_rk3328/evb-rk3328.c            |  8 +-
>   board/rockchip/evb_rk3399/evb-rk3399.c            | 24 +-----
>   board/rockchip/sheep_rk3368/sheep_rk3368.c        |  9 +--
>   board/theobroma-systems/puma_rk3399/puma-rk3399.c | 24 +-----
>   20 files changed, 324 insertions(+), 349 deletions(-)
>   create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_common.h
>   create mode 100644 arch/arm/mach-rockchip/rk3328/sdram_rk3328.c
>   create mode 100644 arch/arm/mach-rockchip/rk3368/sdram_rk3368.c
>   create mode 100644 arch/arm/mach-rockchip/sdram_common.c

     This function tested ok on RK3368 based platform, but it seems that 
you have missed the support for PX5 EVB , GeekBox and RV1108.

     Another things is that I seen the following warning when compile:

  In file included from 
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c:7:0:
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c: 
In function ‘dram_init’:
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c:67:8: 
warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but 
argument 2 has type ‘phys_addr_t {aka long long unsigned int}’ [-Wformat=]
   debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
         ^
/home/andy/WorkSpace/U-BOOT/u-boot/include/common.h:59:21: note: in 
definition of macro ‘pr_fmt’
  #define pr_fmt(fmt) fmt
                      ^
/home/andy/WorkSpace/U-BOOT/u-boot/include/common.h:75:2: note: in 
expansion of macro ‘debug_cond’
   debug_cond(_DEBUG, fmt, ##args)
   ^
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c:67:2: 
note: in expansion of macro ‘debug’
   debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
   ^
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c:67:8: 
warning: format ‘%x’ expects argument of type ‘unsigned int’, but 
argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
   debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
         ^
/home/andy/WorkSpace/U-BOOT/u-boot/include/common.h:59:21: note: in 
definition of macro ‘pr_fmt’
  #define pr_fmt(fmt) fmt
                      ^
/home/andy/WorkSpace/U-BOOT/u-boot/include/common.h:75:2: note: in 
expansion of macro ‘debug_cond’
   debug_cond(_DEBUG, fmt, ##args)
   ^
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/sdram_common.c:67:2: 
note: in expansion of macro ‘debug’
   debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
   ^
   LD      arch/arm/lib/built-in.o
In file included from 
/home/andy/WorkSpace/U-BOOT/u-boot/include/linux/delay.h:8:0,
                  from 
/home/andy/WorkSpace/U-BOOT/u-boot/include/common.h:26,
                  from 
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/rk3368/sdram_rk3368.c:8:
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/rk3368/sdram_rk3368.c: 
In function ‘rk3368_dmc_probe’:
/home/andy/WorkSpace/U-BOOT/u-boot/include/linux/kernel.h:155:17: 
warning: comparison of distinct pointer types lacks a cast
   (void) (&_min1 == &_min2);  \
                  ^
/home/andy/WorkSpace/U-BOOT/u-boot/arch/arm/mach-rockchip/rk3368/sdram_rk3368.c:36:20: 
note: in expansion of macro ‘min’
   priv->info.size = min(priv->info.size, 0xfe000000);
                     ^





More information about the U-Boot mailing list