]> git.sur5r.net Git - u-boot/commitdiff
driver/ddr: Add 256 byte interleaving support
authorYork Sun <yorksun@freescale.com>
Mon, 10 Feb 2014 21:59:44 +0000 (13:59 -0800)
committerTom Rini <trini@ti.com>
Fri, 21 Feb 2014 16:06:13 +0000 (11:06 -0500)
Freescale LayerScape SoCs support controller interleaving on 256 byte size.
This interleaving is mandoratory.

Signed-off-by: York Sun <yorksun@freescale.com>
README
drivers/ddr/fsl/ctrl_regs.c
drivers/ddr/fsl/main.c
drivers/ddr/fsl/options.c
drivers/ddr/fsl/util.c
include/fsl_ddr_sdram.h

diff --git a/README b/README
index 355e8988236fa677301fa82e57f115fc2d4962b6..f51f17ec693f2ae01387df144c64361d9710b7a6 100644 (file)
--- a/README
+++ b/README
@@ -497,6 +497,11 @@ The following options need to be configured:
                same as CONFIG_SYS_DDR_SDRAM_BASE for  all Power SoCs. But
                it could be different for ARM SoCs.
 
+               CONFIG_SYS_FSL_DDR_INTLV_256B
+               DDR controller interleaving on 256-byte. This is a special
+               interleaving mode, handled by Dickens for Freescale layerscape
+               SoCs with ARM core.
+
 - Intel Monahans options:
                CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO
 
index 5acbc737ba0a862c1377d3ab5db34f42d3eb4b3c..0882932b0708083d091002dbcd7b5b6fd97a9a02 100644 (file)
@@ -145,6 +145,7 @@ static void set_csn_config(int dimm_number, int i, fsl_ddr_cfg_regs_t *ddr,
                        if (!popts->memctl_interleaving)
                                break;
                        switch (popts->memctl_interleaving_mode) {
+                       case FSL_DDR_256B_INTERLEAVING:
                        case FSL_DDR_CACHE_LINE_INTERLEAVING:
                        case FSL_DDR_PAGE_INTERLEAVING:
                        case FSL_DDR_BANK_INTERLEAVING:
index dee50a0789b4c975d9b1ed801f8ebc9a16130e0b..d62ca63c7707cdae05b6bd38f991724ebd9e9cd9 100644 (file)
@@ -291,6 +291,7 @@ static unsigned long long __step_assign_addresses(fsl_ddr_info_t *pinfo,
                for (i = 0; i < CONFIG_NUM_DDR_CONTROLLERS; i++) {
                        if (pinfo->memctl_opts[i].memctl_interleaving) {
                                switch (pinfo->memctl_opts[i].memctl_interleaving_mode) {
+                               case FSL_DDR_256B_INTERLEAVING:
                                case FSL_DDR_CACHE_LINE_INTERLEAVING:
                                case FSL_DDR_PAGE_INTERLEAVING:
                                case FSL_DDR_BANK_INTERLEAVING:
index 4aafcceaf5939ae16e764a8619e2bd12e2367613..b0cf046fdcd9ada957ec66367300b37eae246ca9 100644 (file)
@@ -818,21 +818,33 @@ unsigned int populate_memctl_options(int all_dimms_registered,
         * If memory controller interleaving is enabled, then the data
         * bus widths must be programmed identically for all memory controllers.
         *
-        * XXX: Attempt to set all controllers to the same chip select
+        * Attempt to set all controllers to the same chip select
         * interleaving mode. It will do a best effort to get the
         * requested ranks interleaved together such that the result
         * should be a subset of the requested configuration.
+        *
+        * if CONFIG_SYS_FSL_DDR_INTLV_256B is defined, mandatory interleaving
+        * with 256 Byte is enabled.
         */
 #if (CONFIG_NUM_DDR_CONTROLLERS > 1)
        if (!hwconfig_sub_f("fsl_ddr", "ctlr_intlv", buf))
+#ifdef CONFIG_SYS_FSL_DDR_INTLV_256B
+               ;
+#else
                goto done;
-
+#endif
        if (pdimm[0].n_ranks == 0) {
                printf("There is no rank on CS0 for controller %d.\n", ctrl_num);
                popts->memctl_interleaving = 0;
                goto done;
        }
        popts->memctl_interleaving = 1;
+#ifdef CONFIG_SYS_FSL_DDR_INTLV_256B
+       popts->memctl_interleaving_mode = FSL_DDR_256B_INTERLEAVING;
+       popts->memctl_interleaving = 1;
+       debug("256 Byte interleaving\n");
+       goto done;
+#endif
        /*
         * test null first. if CONFIG_HWCONFIG is not defined
         * hwconfig_arg_cmp returns non-zero
@@ -1085,6 +1097,7 @@ void check_interleaving_options(fsl_ddr_info_t *pinfo)
                        "Memory controller interleaving disabled.\n");
        } else {
                switch (check_intlv) {
+               case FSL_DDR_256B_INTERLEAVING:
                case FSL_DDR_CACHE_LINE_INTERLEAVING:
                case FSL_DDR_PAGE_INTERLEAVING:
                case FSL_DDR_BANK_INTERLEAVING:
index 450a4887126f5c6992eadb350bc07080f0617189..ad53658fc92927a525bd2c2f27cbc9ed90fdaf5b 100644 (file)
@@ -228,6 +228,9 @@ void board_add_ram_info(int use_default)
                puts("       DDR Controller Interleaving Mode: ");
 
                switch ((cs0_config >> 24) & 0xf) {
+               case FSL_DDR_256B_INTERLEAVING:
+                       puts("256B");
+                       break;
                case FSL_DDR_CACHE_LINE_INTERLEAVING:
                        puts("cache line");
                        break;
index 16cccc770836b91ba1b41804b27550305ab4686c..2a36431146d76a2b2ccfc33adfab17d90873122f 100644 (file)
@@ -76,6 +76,7 @@ typedef ddr3_spd_eeprom_t generic_spd_eeprom_t;
 #define FSL_DDR_PAGE_INTERLEAVING      0x1
 #define FSL_DDR_BANK_INTERLEAVING      0x2
 #define FSL_DDR_SUPERBANK_INTERLEAVING 0x3
+#define FSL_DDR_256B_INTERLEAVING      0x8
 #define FSL_DDR_3WAY_1KB_INTERLEAVING  0xA
 #define FSL_DDR_3WAY_4KB_INTERLEAVING  0xC
 #define FSL_DDR_3WAY_8KB_INTERLEAVING  0xD