Commit e1a0888ed224cc4c4e019a37b7b0331b11745e4d

Authored by Hans de Goede
1 parent 046664aedd

sunxi: Convert sun5i boards to use auto dram configuration

Currently we've separate detailed dram settings for all sun5i boards, this
moves them over to using auto dram configuration so that we can get rid of
all the per board dram_foo.c files.

This has been tested on a A10s-Olinuxino, A13-Olinuxino, A13-OlinuxinoM,
mk802-a10s and r7-tv-dongle board.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>

Showing 12 changed files with 19 additions and 169 deletions Side-by-side Diff

... ... @@ -39,16 +39,14 @@
39 39 default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
40 40 ---help---
41 41 Set the dram clock speed, valid range 240 - 480, must be a multiple
42   - of 24. Note on sun4i / sun5i / sun7i this is only used by boards
43   - which use dram autoconfig.
  42 + of 24.
44 43  
45 44 config DRAM_ZQ
46 45 int "sunxi dram zq value"
47 46 default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
48 47 default 127 if MACH_SUN7I
49 48 ---help---
50   - Set the dram zq value. Note on sun4i / sun5i / sun7i this is only
51   - used by boards which use dram autoconfig.
  49 + Set the dram zq value.
52 50  
53 51 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
54 52 config DRAM_EMR1
... ... @@ -56,8 +54,7 @@
56 54 default 0 if MACH_SUN4I
57 55 default 4 if MACH_SUN5I || MACH_SUN7I
58 56 ---help---
59   - Set the dram controller emr1 value. Note this is only used by boards
60   - which use dram autoconfig.
  57 + Set the dram controller emr1 value.
61 58 endif
62 59  
63 60 config SYS_CONFIG_NAME
board/sunxi/Makefile
... ... @@ -12,12 +12,6 @@
12 12 obj-$(CONFIG_SUNXI_GMAC) += gmac.o
13 13 obj-$(CONFIG_SUNXI_AHCI) += ahci.o
14 14 obj-$(CONFIG_MACH_SUN4I) += dram_sun4i_auto.o
  15 +obj-$(CONFIG_MACH_SUN5I) += dram_sun5i_auto.o
15 16 obj-$(CONFIG_MACH_SUN7I) += dram_sun5i_auto.o
16   -obj-$(CONFIG_TARGET_A10S_OLINUXINO_M) += dram_a10s_olinuxino_m.o
17   -obj-$(CONFIG_TARGET_A13_OLINUXINO) += dram_a13_olinuxino.o
18   -obj-$(CONFIG_TARGET_A13_OLINUXINOM) += dram_a13_oli_micro.o
19   -# This is not a typo, uses the same mem settings as the a10s-olinuxino-m
20   -obj-$(CONFIG_TARGET_AUXTEK_T004) += dram_a10s_olinuxino_m.o
21   -obj-$(CONFIG_TARGET_MK802_A10S) += dram_sun5i_auto.o
22   -obj-$(CONFIG_TARGET_R7DONGLE) += dram_r7dongle.o
board/sunxi/dram_a10s_olinuxino_m.c
1   -/* this file is generated, don't edit it yourself */
2   -
3   -#include <common.h>
4   -#include <asm/arch/dram.h>
5   -
6   -static struct dram_para dram_para = {
7   - .clock = 432,
8   - .type = 3,
9   - .rank_num = 1,
10   - .density = 4096,
11   - .io_width = 16,
12   - .bus_width = 16,
13   - .cas = 9,
14   - .zq = 123,
15   - .odt_en = 0,
16   - .size = 512,
17   - .tpr0 = 0x42d899b7,
18   - .tpr1 = 0xa090,
19   - .tpr2 = 0x22a00,
20   - .tpr3 = 0,
21   - .tpr4 = 0,
22   - .tpr5 = 0,
23   - .emr1 = 0x4,
24   - .emr2 = 0x10,
25   - .emr3 = 0,
26   -};
27   -
28   -unsigned long sunxi_dram_init(void)
29   -{
30   - return dramc_init(&dram_para);
31   -}
board/sunxi/dram_a13_oli_micro.c
1   -/* this file is generated, don't edit it yourself */
2   -
3   -#include <common.h>
4   -#include <asm/arch/dram.h>
5   -
6   -static struct dram_para dram_para = {
7   - .clock = 408,
8   - .type = 3,
9   - .rank_num = 1,
10   - .density = 2048,
11   - .io_width = 16,
12   - .bus_width = 16,
13   - .cas = 9,
14   - .zq = 123,
15   - .odt_en = 0,
16   - .size = 256,
17   - .tpr0 = 0x42d899b7,
18   - .tpr1 = 0xa090,
19   - .tpr2 = 0x22a00,
20   - .tpr3 = 0,
21   - .tpr4 = 0,
22   - .tpr5 = 0,
23   - .emr1 = 0,
24   - .emr2 = 0x10,
25   - .emr3 = 0,
26   -
27   -};
28   -
29   -unsigned long sunxi_dram_init(void)
30   -{
31   - return dramc_init(&dram_para);
32   -}
board/sunxi/dram_a13_olinuxino.c
1   -/* this file is generated, don't edit it yourself */
2   -
3   -#include <common.h>
4   -#include <asm/arch/dram.h>
5   -
6   -static struct dram_para dram_para = {
7   - .clock = 408,
8   - .type = 3,
9   - .rank_num = 1,
10   - .density = 2048,
11   - .io_width = 8,
12   - .bus_width = 16,
13   - .cas = 9,
14   - .zq = 123,
15   - .odt_en = 0,
16   - .size = 512,
17   - .tpr0 = 0x42d899b7,
18   - .tpr1 = 0xa090,
19   - .tpr2 = 0x22a00,
20   - .tpr3 = 0,
21   - .tpr4 = 0,
22   - .tpr5 = 0,
23   - .emr1 = 0,
24   - .emr2 = 0x10,
25   - .emr3 = 0,
26   -};
27   -
28   -unsigned long sunxi_dram_init(void)
29   -{
30   - return dramc_init(&dram_para);
31   -}
board/sunxi/dram_bananapi.c
1   -/* this file is generated, don't edit it yourself */
2   -
3   -#include <common.h>
4   -#include <asm/arch/dram.h>
5   -
6   -static struct dram_para dram_para = {
7   - .clock = 432,
8   - .type = 3,
9   - .rank_num = 1,
10   - .density = 4096,
11   - .io_width = 16,
12   - .bus_width = 32,
13   - .cas = 9,
14   - .zq = 0x7f,
15   - .odt_en = 0,
16   - .size = 1024,
17   - .tpr0 = 0x42d899b7,
18   - .tpr1 = 0xa090,
19   - .tpr2 = 0x22a00,
20   - .tpr3 = 0x0,
21   - .tpr4 = 0x1,
22   - .tpr5 = 0x0,
23   - .emr1 = 0x4,
24   - .emr2 = 0x10,
25   - .emr3 = 0x0,
26   -};
27   -
28   -unsigned long sunxi_dram_init(void)
29   -{
30   - return dramc_init(&dram_para);
31   -}
board/sunxi/dram_r7dongle.c
1   -/* this file is generated, don't edit it yourself */
2   -
3   -#include <common.h>
4   -#include <asm/arch/dram.h>
5   -
6   -static struct dram_para dram_para = {
7   - .clock = 384,
8   - .type = 3,
9   - .rank_num = 1,
10   - .density = 2048,
11   - .io_width = 8,
12   - .bus_width = 32,
13   - .cas = 9,
14   - .zq = 123,
15   - .odt_en = 0,
16   - .size = 1024,
17   - .tpr0 = 0x42d899b7,
18   - .tpr1 = 0xa090,
19   - .tpr2 = 0x22a00,
20   - .tpr3 = 0,
21   - .tpr4 = 0,
22   - .tpr5 = 0,
23   - .emr1 = 0x04,
24   - .emr2 = 0x10,
25   - .emr3 = 0,
26   -};
27   -
28   -unsigned long sunxi_dram_init(void)
29   -{
30   - return dramc_init(&dram_para);
31   -}
configs/A10s-OLinuXino-M_defconfig
... ... @@ -9,4 +9,7 @@
9 9 +S:CONFIG_ARCH_SUNXI=y
10 10 +S:CONFIG_MACH_SUN5I=y
11 11 +S:CONFIG_TARGET_A10S_OLINUXINO_M=y
  12 ++S:CONFIG_DRAM_CLK=432
  13 ++S:CONFIG_DRAM_ZQ=123
  14 ++S:CONFIG_DRAM_EMR1=4
configs/A13-OLinuXinoM_defconfig
... ... @@ -13,4 +13,7 @@
13 13 +S:CONFIG_ARCH_SUNXI=y
14 14 +S:CONFIG_MACH_SUN5I=y
15 15 +S:CONFIG_TARGET_A13_OLINUXINOM=y
  16 ++S:CONFIG_DRAM_CLK=408
  17 ++S:CONFIG_DRAM_ZQ=123
  18 ++S:CONFIG_DRAM_EMR1=0
configs/A13-OLinuXino_defconfig
... ... @@ -13,4 +13,7 @@
13 13 +S:CONFIG_ARCH_SUNXI=y
14 14 +S:CONFIG_MACH_SUN5I=y
15 15 +S:CONFIG_TARGET_A13_OLINUXINO=y
  16 ++S:CONFIG_DRAM_CLK=408
  17 ++S:CONFIG_DRAM_ZQ=123
  18 ++S:CONFIG_DRAM_EMR1=0
configs/Auxtek-T004_defconfig
... ... @@ -6,4 +6,7 @@
6 6 +S:CONFIG_ARCH_SUNXI=y
7 7 +S:CONFIG_MACH_SUN5I=y
8 8 +S:CONFIG_TARGET_AUXTEK_T004=y
  9 ++S:CONFIG_DRAM_CLK=432
  10 ++S:CONFIG_DRAM_ZQ=123
  11 ++S:CONFIG_DRAM_EMR1=4
configs/r7-tv-dongle_defconfig
... ... @@ -6,4 +6,7 @@
6 6 +S:CONFIG_ARCH_SUNXI=y
7 7 +S:CONFIG_MACH_SUN5I=y
8 8 +S:CONFIG_TARGET_R7DONGLE=y
  9 ++S:CONFIG_DRAM_CLK=384
  10 ++S:CONFIG_DRAM_ZQ=123
  11 ++S:CONFIG_DRAM_EMR1=4