* [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards
@ 2014-12-08 6:09 Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 01/13] ARM: atmel: clock: make it possible to configure HMX32 Bo Shen
` (12 more replies)
0 siblings, 13 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
This patch enable SPL support for both sama5d4ek and sama5d4 xplained
board which are based on SAMA5D4 SoC.
These two boards both support boot up from NAND flash, SD/MMC card and
also serial flash.
This patch series based on the "ARM: atmel: enable usb ethernet gadget"
Bo Shen (13):
ARM: atmel: clock: make it possible to configure HMX32
ARM: atmel: sama5: add bus matrix header file
ARM: atmel: sama5: add sfr register header file
ARM: atmel: spl: add weak bus matrix init function
ARM: atmel: spl: add saic to aic redirect function
ARM: atmel: spl: can not disable osc for sama5d4
ARM: atmel: sama5d4: add matrix1 base addr definition
ARM: atmel: sama5d4: add bus matrix init function
ARM: atmel: sama5d4: add interrupt redirec function
ARM: atmel: sama5d4: can access DDR in interleave mode
ARM: atmel: sama5d4: build related file when enable SPL
ARM: atmel: sama5d4ek: enable SPL support
ARM: atmel: sama5d4_xplained: enable spl support
arch/arm/Kconfig | 2 +
arch/arm/cpu/armv7/at91/clock.c | 8 +++
arch/arm/cpu/armv7/at91/sama5d4_devices.c | 47 ++++++++++++++
arch/arm/cpu/at91-common/Makefile | 1 +
arch/arm/cpu/at91-common/mpddrc.c | 2 +-
arch/arm/cpu/at91-common/spl_atmel.c | 16 +++++
arch/arm/include/asm/arch-at91/at91_common.h | 1 +
arch/arm/include/asm/arch-at91/sama5_matrix.h | 37 +++++++++++
arch/arm/include/asm/arch-at91/sama5_sfr.h | 38 +++++++++++
arch/arm/include/asm/arch-at91/sama5d4.h | 2 +
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 85 +++++++++++++++++++++++++
board/atmel/sama5d4ek/sama5d4ek.c | 85 +++++++++++++++++++++++++
configs/sama5d4_xplained_mmc_defconfig | 1 +
configs/sama5d4_xplained_nandflash_defconfig | 1 +
configs/sama5d4_xplained_spiflash_defconfig | 1 +
configs/sama5d4ek_mmc_defconfig | 1 +
configs/sama5d4ek_nandflash_defconfig | 1 +
configs/sama5d4ek_spiflash_defconfig | 1 +
include/configs/sama5d4_xplained.h | 56 ++++++++++++++++
include/configs/sama5d4ek.h | 56 ++++++++++++++++
20 files changed, 441 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/include/asm/arch-at91/sama5_matrix.h
create mode 100644 arch/arm/include/asm/arch-at91/sama5_sfr.h
--
2.1.0.24.g4109c28
^ permalink raw reply [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 01/13] ARM: atmel: clock: make it possible to configure HMX32
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 02/13] ARM: atmel: sama5: add bus matrix header file Bo Shen
` (11 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/armv7/at91/clock.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/cpu/armv7/at91/clock.c b/arch/arm/cpu/armv7/at91/clock.c
index 2cdddb2..0bf453e 100644
--- a/arch/arm/cpu/armv7/at91/clock.c
+++ b/arch/arm/cpu/armv7/at91/clock.c
@@ -130,10 +130,18 @@ void at91_mck_init(u32 mckr)
AT91_PMC_MCKR_PRES_MASK |
AT91_PMC_MCKR_MDIV_MASK |
AT91_PMC_MCKR_PLLADIV_2);
+#ifdef CPU_HAS_H32MXDIV
+ tmp &= ~AT91_PMC_MCKR_H32MXDIV;
+#endif
+
tmp |= mckr & (AT91_PMC_MCKR_CSS_MASK |
AT91_PMC_MCKR_PRES_MASK |
AT91_PMC_MCKR_MDIV_MASK |
AT91_PMC_MCKR_PLLADIV_2);
+#ifdef CPU_HAS_H32MXDIV
+ tmp |= mckr & AT91_PMC_MCKR_H32MXDIV;
+#endif
+
writel(tmp, &pmc->mckr);
while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY))
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 02/13] ARM: atmel: sama5: add bus matrix header file
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 01/13] ARM: atmel: clock: make it possible to configure HMX32 Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 03/13] ARM: atmel: sama5: add sfr register " Bo Shen
` (10 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
This matrix header file can be shared between sama5d3 and sama5d4 soc.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/include/asm/arch-at91/sama5_matrix.h | 37 +++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 arch/arm/include/asm/arch-at91/sama5_matrix.h
diff --git a/arch/arm/include/asm/arch-at91/sama5_matrix.h b/arch/arm/include/asm/arch-at91/sama5_matrix.h
new file mode 100644
index 0000000..f58dc97
--- /dev/null
+++ b/arch/arm/include/asm/arch-at91/sama5_matrix.h
@@ -0,0 +1,37 @@
+/*
+ * Bus Matrix header file for the SAMA5 family
+ *
+ * Copyright (C) 2014 Atmel
+ * Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __SAMA5_MATRIX_H
+#define __SAMA5_MATRIX_H
+
+struct atmel_matrix {
+ u32 mcfg[16]; /* 0x00 ~ 0x3c: Master Configuration Register */
+ u32 scfg[16]; /* 0x40 ~ 0x7c: Slave Configuration Register */
+ u32 pras[16][2]; /* 0x80 ~ 0xfc: Priority Register A/B */
+ u32 reserved1[20]; /* 0x100 ~ 0x14c */
+ u32 meier; /* 0x150: Master Error Interrupt Enable Register */
+ u32 meidr; /* 0x154: Master Error Interrupt Disable Register */
+ u32 meimr; /* 0x158: Master Error Interrupt Mask Register */
+ u32 mesr; /* 0x15c: Master Error Status Register */
+ u32 mear[16]; /* 0x160 ~ 0x19c: Master Error Address Register */
+ u32 reserved2[17]; /* 0x1A0 ~ 0x1E0 */
+ u32 wpmr; /* 0x1E4: Write Protection Mode Register */
+ u32 wpsr; /* 0x1E8: Write Protection Status Register */
+ u32 reserved3[5]; /* 0x1EC ~ 0x1FC */
+ u32 ssr[16]; /* 0x200 ~ 0x23c: Security Slave Register */
+ u32 sassr[16]; /* 0x240 ~ 0x27c: Security Areas Split Slave Register */
+ u32 srtsr[16]; /* 0x280 ~ 0x2bc: Security Region Top Slave */
+ u32 spselr[3]; /* 0x2c0 ~ 0x2c8: Security Peripheral Select Register */
+};
+
+/* Bit field in WPMR */
+#define ATMEL_MATRIX_WPMR_WPKEY 0x4D415400
+#define ATMEL_MATRIX_WPMR_WPEN 0x00000001
+
+#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 03/13] ARM: atmel: sama5: add sfr register header file
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 01/13] ARM: atmel: clock: make it possible to configure HMX32 Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 02/13] ARM: atmel: sama5: add bus matrix header file Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 04/13] ARM: atmel: spl: add weak bus matrix init function Bo Shen
` (9 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
The SFR (special function registers) can be shared bwteen
sama5d3 and sama5d4 soc.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/include/asm/arch-at91/sama5_sfr.h | 38 ++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 arch/arm/include/asm/arch-at91/sama5_sfr.h
diff --git a/arch/arm/include/asm/arch-at91/sama5_sfr.h b/arch/arm/include/asm/arch-at91/sama5_sfr.h
new file mode 100644
index 0000000..d3d2439
--- /dev/null
+++ b/arch/arm/include/asm/arch-at91/sama5_sfr.h
@@ -0,0 +1,38 @@
+/*
+ * Special Function Register (SFR)
+ *
+ * Copyright (C) 2014 Atmel
+ * Bo Shen <voice.shen@atmel.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __SAMA5_SFR_H
+#define __SAMA5_SFR_H
+
+struct atmel_sfr {
+ u32 reserved1; /* 0x00 */
+ u32 ddrcfg; /* 0x04: DDR Configuration Register */
+ u32 reserved2; /* 0x08 */
+ u32 reserved3; /* 0x0c */
+ u32 ohciicr; /* 0x10: OHCI Interrupt Configuration Register */
+ u32 ohciisr; /* 0x14: OHCI Interrupt Status Register */
+ u32 reserved4[4]; /* 0x18 ~ 0x24 */
+ u32 secure; /* 0x28: Security Configuration Register */
+ u32 reserved5[5]; /* 0x2c ~ 0x3c */
+ u32 ebicfg; /* 0x40: EBI Configuration Register */
+ u32 reserved6[2]; /* 0x44 ~ 0x48 */
+ u32 sn0; /* 0x4c */
+ u32 sn1; /* 0x50 */
+ u32 aicredir; /* 0x54 */
+};
+
+/* Bit field in DDRCFG */
+#define ATMEL_SFR_DDRCFG_FDQIEN 0x00010000
+#define ATMEL_SFR_DDRCFG_FDQSIEN 0x00020000
+
+/* Bit field in AICREDIR */
+#define ATMEL_SFR_AICREDIR_KEY 0x5F67B102
+#define ATMEL_SFR_AICREDIR_NSAIC 0x00000001
+
+#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 04/13] ARM: atmel: spl: add weak bus matrix init function
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (2 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 03/13] ARM: atmel: sama5: add sfr register " Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 05/13] ARM: atmel: spl: add saic to aic redirect function Bo Shen
` (8 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Some SoC need to configure the bus matrix, add an weak function
to be replace by real function.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/at91-common/spl_atmel.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/cpu/at91-common/spl_atmel.c b/arch/arm/cpu/at91-common/spl_atmel.c
index 7297530..9cb5770 100644
--- a/arch/arm/cpu/at91-common/spl_atmel.c
+++ b/arch/arm/cpu/at91-common/spl_atmel.c
@@ -58,6 +58,11 @@ static void switch_to_main_crystal_osc(void)
writel(tmp, &pmc->mor);
}
+__weak void matrix_init(void)
+{
+ /* This only be used for sama5d4 soc now */
+}
+
void s_init(void)
{
switch_to_main_crystal_osc();
@@ -70,6 +75,8 @@ void s_init(void)
at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK);
+ matrix_init();
+
timer_init();
board_early_init_f();
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 05/13] ARM: atmel: spl: add saic to aic redirect function
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (3 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 04/13] ARM: atmel: spl: add weak bus matrix init function Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 06/13] ARM: atmel: spl: can not disable osc for sama5d4 Bo Shen
` (7 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Some SoC need to redirect the saic to aic to make the interrupt to
work, here add a weak function to be replaced by real function.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/at91-common/spl_atmel.c | 7 +++++++
arch/arm/include/asm/arch-at91/at91_common.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/arch/arm/cpu/at91-common/spl_atmel.c b/arch/arm/cpu/at91-common/spl_atmel.c
index 9cb5770..fdea466 100644
--- a/arch/arm/cpu/at91-common/spl_atmel.c
+++ b/arch/arm/cpu/at91-common/spl_atmel.c
@@ -63,6 +63,11 @@ __weak void matrix_init(void)
/* This only be used for sama5d4 soc now */
}
+__weak void redirect_int_from_saic_to_aic(void)
+{
+ /* This only be used for sama5d4 soc now */
+}
+
void s_init(void)
{
switch_to_main_crystal_osc();
@@ -77,6 +82,8 @@ void s_init(void)
matrix_init();
+ redirect_int_from_saic_to_aic();
+
timer_init();
board_early_init_f();
diff --git a/arch/arm/include/asm/arch-at91/at91_common.h b/arch/arm/include/asm/arch-at91/at91_common.h
index 912e55c..efcd74e 100644
--- a/arch/arm/include/asm/arch-at91/at91_common.h
+++ b/arch/arm/include/asm/arch-at91/at91_common.h
@@ -33,5 +33,6 @@ void at91_mck_init(u32 mckr);
void at91_spl_board_init(void);
void at91_disable_wdt(void);
void matrix_init(void);
+void redirect_int_from_saic_to_aic(void);
#endif /* AT91_COMMON_H */
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 06/13] ARM: atmel: spl: can not disable osc for sama5d4
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (4 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 05/13] ARM: atmel: spl: add saic to aic redirect function Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 07/13] ARM: atmel: sama5d4: add matrix1 base addr definition Bo Shen
` (6 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
The SAMA5D4 SoC on chip rc oscillator can not be disabled.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/at91-common/spl_atmel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/cpu/at91-common/spl_atmel.c b/arch/arm/cpu/at91-common/spl_atmel.c
index fdea466..9cc1111 100644
--- a/arch/arm/cpu/at91-common/spl_atmel.c
+++ b/arch/arm/cpu/at91-common/spl_atmel.c
@@ -51,11 +51,13 @@ static void switch_to_main_crystal_osc(void)
while (!(readl(&pmc->mcfr) & AT91_PMC_MAINRDY))
;
+#ifndef CONFIG_SAMA5D4
tmp = readl(&pmc->mor);
tmp &= ~AT91_PMC_MOR_MOSCRCEN;
tmp &= ~AT91_PMC_MOR_KEY(0xff);
tmp |= AT91_PMC_MOR_KEY(0x37);
writel(tmp, &pmc->mor);
+#endif
}
__weak void matrix_init(void)
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 07/13] ARM: atmel: sama5d4: add matrix1 base addr definition
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (5 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 06/13] ARM: atmel: spl: can not disable osc for sama5d4 Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 08/13] ARM: atmel: sama5d4: add bus matrix init function Bo Shen
` (5 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/include/asm/arch-at91/sama5d4.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/include/asm/arch-at91/sama5d4.h b/arch/arm/include/asm/arch-at91/sama5d4.h
index d851568..f30cb5f 100644
--- a/arch/arm/include/asm/arch-at91/sama5d4.h
+++ b/arch/arm/include/asm/arch-at91/sama5d4.h
@@ -126,6 +126,8 @@
#define ATMEL_BASE_ADC 0xfc034000
#define ATMEL_BASE_TWI3 0xfc038000
+#define ATMEL_BASE_MATRIX1 0xfc054000
+
#define ATMEL_BASE_SMC 0xfc05c000
#define ATMEL_BASE_PMECC (ATMEL_BASE_SMC + 0x070)
#define ATMEL_BASE_PMERRLOC (ATMEL_BASE_SMC + 0x500)
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 08/13] ARM: atmel: sama5d4: add bus matrix init function
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (6 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 07/13] ARM: atmel: sama5d4: add matrix1 base addr definition Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 09/13] ARM: atmel: sama5d4: add interrupt redirec function Bo Shen
` (4 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/armv7/at91/sama5d4_devices.c | 35 +++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/arch/arm/cpu/armv7/at91/sama5d4_devices.c b/arch/arm/cpu/armv7/at91/sama5d4_devices.c
index 7469825..9c63e99 100644
--- a/arch/arm/cpu/armv7/at91/sama5d4_devices.c
+++ b/arch/arm/cpu/armv7/at91/sama5d4_devices.c
@@ -10,6 +10,7 @@
#include <asm/arch/at91_common.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/clk.h>
+#include <asm/arch/sama5_matrix.h>
#include <asm/arch/sama5d4.h>
char *get_cpu_name()
@@ -44,3 +45,37 @@ void at91_udp_hw_init(void)
at91_periph_clk_enable(ATMEL_ID_UDPHS);
}
#endif
+
+#ifdef CONFIG_SPL_BUILD
+void matrix_init(void)
+{
+ struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
+ struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
+ int i;
+
+ /* Disable the write protect */
+ writel(ATMEL_MATRIX_WPMR_WPKEY & ~ATMEL_MATRIX_WPMR_WPEN, &h64mx->wpmr);
+ writel(ATMEL_MATRIX_WPMR_WPKEY & ~ATMEL_MATRIX_WPMR_WPEN, &h32mx->wpmr);
+
+ /* DDR port 1 ~ poart 7, slave number is: 4 ~ 10 */
+ for (i = 4; i <= 10; i++) {
+ writel(0x000f0f0f, &h64mx->ssr[i]);
+ writel(0x0000ffff, &h64mx->sassr[i]);
+ writel(0x0000000f, &h64mx->srtsr[i]);
+ }
+
+ /* CS3 */
+ writel(0x00c0c0c0, &h32mx->ssr[3]);
+ writel(0xff000000, &h32mx->sassr[3]);
+ writel(0xff000000, &h32mx->srtsr[3]);
+
+ /* NFC SRAM */
+ writel(0x00010101, &h32mx->ssr[4]);
+ writel(0x00000001, &h32mx->sassr[4]);
+ writel(0x00000001, &h32mx->srtsr[4]);
+
+ /* Enable the write protect */
+ writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h64mx->wpmr);
+ writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h32mx->wpmr);
+}
+#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 09/13] ARM: atmel: sama5d4: add interrupt redirec function
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (7 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 08/13] ARM: atmel: sama5d4: add bus matrix init function Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 10/13] ARM: atmel: sama5d4: can access DDR in interleave mode Bo Shen
` (3 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/armv7/at91/sama5d4_devices.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/cpu/armv7/at91/sama5d4_devices.c b/arch/arm/cpu/armv7/at91/sama5d4_devices.c
index 9c63e99..ef39cb7 100644
--- a/arch/arm/cpu/armv7/at91/sama5d4_devices.c
+++ b/arch/arm/cpu/armv7/at91/sama5d4_devices.c
@@ -11,6 +11,7 @@
#include <asm/arch/at91_pmc.h>
#include <asm/arch/clk.h>
#include <asm/arch/sama5_matrix.h>
+#include <asm/arch/sama5_sfr.h>
#include <asm/arch/sama5d4.h>
char *get_cpu_name()
@@ -78,4 +79,15 @@ void matrix_init(void)
writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h64mx->wpmr);
writel(ATMEL_MATRIX_WPMR_WPKEY | ATMEL_MATRIX_WPMR_WPEN, &h32mx->wpmr);
}
+
+void redirect_int_from_saic_to_aic(void)
+{
+ struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR;
+ u32 key32;
+
+ if (!(readl(&sfr->aicredir) & ATMEL_SFR_AICREDIR_NSAIC)) {
+ key32 = readl(&sfr->sn1) ^ ATMEL_SFR_AICREDIR_KEY;
+ writel((key32 | ATMEL_SFR_AICREDIR_NSAIC), &sfr->aicredir);
+ }
+}
#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 10/13] ARM: atmel: sama5d4: can access DDR in interleave mode
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (8 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 09/13] ARM: atmel: sama5d4: add interrupt redirec function Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 11/13] ARM: atmel: sama5d4: build related file when enable SPL Bo Shen
` (2 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
The SAMAA5D4 SoC can access DDR in interleave mode.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/at91-common/mpddrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/cpu/at91-common/mpddrc.c b/arch/arm/cpu/at91-common/mpddrc.c
index 44798e6..beec13d 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -19,7 +19,7 @@ static inline void atmel_mpddr_op(int mode, u32 ram_address)
static int ddr2_decodtype_is_seq(u32 cr)
{
-#if defined(CONFIG_SAMA5D3)
+#if defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4)
if (cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED)
return 0;
#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 11/13] ARM: atmel: sama5d4: build related file when enable SPL
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (9 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 10/13] ARM: atmel: sama5d4: can access DDR in interleave mode Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support Bo Shen
12 siblings, 0 replies; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/cpu/at91-common/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/cpu/at91-common/Makefile b/arch/arm/cpu/at91-common/Makefile
index 89e1577..03614d4 100644
--- a/arch/arm/cpu/at91-common/Makefile
+++ b/arch/arm/cpu/at91-common/Makefile
@@ -13,5 +13,6 @@ ifneq ($(CONFIG_SPL_BUILD),)
obj-$(CONFIG_AT91SAM9G20) += sdram.o spl_at91.o
obj-$(CONFIG_AT91SAM9M10G45) += mpddrc.o spl_at91.o
obj-$(CONFIG_SAMA5D3) += mpddrc.o spl_atmel.o
+obj-$(CONFIG_SAMA5D4) += mpddrc.o spl_atmel.o
obj-y += spl.o
endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (10 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 11/13] ARM: atmel: sama5d4: build related file when enable SPL Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-10 21:38 ` Robert Nelson
2014-12-08 6:09 ` [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support Bo Shen
12 siblings, 1 reply; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
The sama5d4ek support boot up from NAND flash, SD/MMC card and
also the SPI flash.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/Kconfig | 1 +
board/atmel/sama5d4ek/sama5d4ek.c | 85 +++++++++++++++++++++++++++++++++++
configs/sama5d4ek_mmc_defconfig | 1 +
configs/sama5d4ek_nandflash_defconfig | 1 +
configs/sama5d4ek_spiflash_defconfig | 1 +
include/configs/sama5d4ek.h | 56 +++++++++++++++++++++++
6 files changed, 145 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0982117..091d615 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -518,6 +518,7 @@ config TARGET_SAMA5D4_XPLAINED
config TARGET_SAMA5D4EK
bool "Support sama5d4ek"
select CPU_V7
+ select SUPPORT_SPL
config TARGET_BCM28155_AP
bool "Support bcm28155_ap"
diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c
index e014e0a..f8cff68 100644
--- a/board/atmel/sama5d4ek/sama5d4ek.c
+++ b/board/atmel/sama5d4ek/sama5d4ek.c
@@ -10,6 +10,7 @@
#include <asm/arch/at91_common.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/at91_rstc.h>
+#include <asm/arch/atmel_mpddrc.h>
#include <asm/arch/atmel_usba_udc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/clk.h>
@@ -326,3 +327,87 @@ int board_eth_init(bd_t *bis)
return rc;
}
+
+/* SPL */
+#ifdef CONFIG_SPL_BUILD
+void spl_board_init(void)
+{
+#ifdef CONFIG_SYS_USE_MMC
+ sama5d4ek_mci1_hw_init();
+#elif CONFIG_SYS_USE_NANDFLASH
+ sama5d4ek_nand_hw_init();
+#elif CONFIG_SYS_USE_SERIALFLASH
+ sama5d4ek_spi0_hw_init();
+#endif
+}
+
+static void ddr2_conf(struct atmel_mpddr *ddr2)
+{
+ ddr2->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
+
+ ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
+ ATMEL_MPDDRC_CR_NR_ROW_14 |
+ ATMEL_MPDDRC_CR_CAS_DDR_CAS3 |
+ ATMEL_MPDDRC_CR_NB_8BANKS |
+ ATMEL_MPDDRC_CR_NDQS_DISABLED |
+ ATMEL_MPDDRC_CR_DECOD_INTERLEAVED |
+ ATMEL_MPDDRC_CR_UNAL_SUPPORTED);
+
+ ddr2->rtr = 0x2b0;
+
+ ddr2->tpr0 = (8 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TWR_OFFSET |
+ 10 << ATMEL_MPDDRC_TPR0_TRC_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TRP_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET);
+
+ ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET |
+ 200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
+ 25 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
+ 23 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
+
+ ddr2->tpr2 = (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
+ 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
+}
+
+void mem_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ struct atmel_mpddr ddr2;
+
+ ddr2_conf(&ddr2);
+
+ /* enable MPDDR clock */
+ at91_periph_clk_enable(ATMEL_ID_MPDDRC);
+ writel(0x4, &pmc->scer);
+
+ /* DDRAM2 Controller initialize */
+ ddr2_init(ATMEL_BASE_DDRCS, &ddr2);
+}
+
+void at91_pmc_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ u32 tmp;
+
+ tmp = AT91_PMC_PLLAR_29 |
+ AT91_PMC_PLLXR_PLLCOUNT(0x3f) |
+ AT91_PMC_PLLXR_MUL(87) |
+ AT91_PMC_PLLXR_DIV(1);
+ at91_plla_init(tmp);
+
+ writel(0x0 << 8, &pmc->pllicpr);
+
+ tmp = AT91_PMC_MCKR_H32MXDIV |
+ AT91_PMC_MCKR_PLLADIV_2 |
+ AT91_PMC_MCKR_MDIV_3 |
+ AT91_PMC_MCKR_CSS_PLLA;
+ at91_mck_init(tmp);
+}
+#endif
diff --git a/configs/sama5d4ek_mmc_defconfig b/configs/sama5d4ek_mmc_defconfig
index 16a5ed7..aafb4c2 100644
--- a/configs/sama5d4ek_mmc_defconfig
+++ b/configs/sama5d4ek_mmc_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4EK=y
diff --git a/configs/sama5d4ek_nandflash_defconfig b/configs/sama5d4ek_nandflash_defconfig
index 8b7fbc3..d430fa7 100644
--- a/configs/sama5d4ek_nandflash_defconfig
+++ b/configs/sama5d4ek_nandflash_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4EK=y
diff --git a/configs/sama5d4ek_spiflash_defconfig b/configs/sama5d4ek_spiflash_defconfig
index 63e9b6c..796fa4b 100644
--- a/configs/sama5d4ek_spiflash_defconfig
+++ b/configs/sama5d4ek_spiflash_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4EK=y
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index 09ab4d7..9efa096 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -20,7 +20,9 @@
#define CONFIG_ARCH_CPU_INIT
+#ifndef CONFIG_SPL_BUILD
#define CONFIG_SKIP_LOWLEVEL_INIT
+#endif
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_DISPLAY_CPUINFO
@@ -66,8 +68,12 @@
#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
#define CONFIG_SYS_SDRAM_SIZE 0x20000000
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_INIT_SP_ADDR 0x210000
+#else
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
+#endif
#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
@@ -219,4 +225,54 @@
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
+
+/* SPL */
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_TEXT_BASE 0x200000
+#define CONFIG_SPL_MAX_SIZE 0x10000
+#define CONFIG_SPL_BSS_START_ADDR 0x20000000
+#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
+#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+
+#define CONFIG_SPL_BOARD_INIT
+#define CONFIG_SYS_MONITOR_LEN (512 << 10)
+
+#ifdef CONFIG_SYS_USE_MMC
+#define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+
+#elif CONFIG_SYS_USE_NANDFLASH
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_DRIVERS
+#define CONFIG_SPL_NAND_BASE
+#define CONFIG_PMECC_CAP 8
+#define CONFIG_PMECC_SECTOR_SIZE 512
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_SIZE 0x1000
+#define CONFIG_SYS_NAND_PAGE_COUNT 64
+#define CONFIG_SYS_NAND_OOBSIZE 224
+#define CONFIG_SYS_NAND_BLOCK_SIZE 0x40000
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
+#define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
+
+#elif CONFIG_SYS_USE_SERIALFLASH
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
+
+#endif
#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
` (11 preceding siblings ...)
2014-12-08 6:09 ` [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support Bo Shen
@ 2014-12-08 6:09 ` Bo Shen
2014-12-10 21:35 ` Robert Nelson
12 siblings, 1 reply; 19+ messages in thread
From: Bo Shen @ 2014-12-08 6:09 UTC (permalink / raw)
To: u-boot
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
arch/arm/Kconfig | 1 +
board/atmel/sama5d4_xplained/sama5d4_xplained.c | 85 +++++++++++++++++++++++++
configs/sama5d4_xplained_mmc_defconfig | 1 +
configs/sama5d4_xplained_nandflash_defconfig | 1 +
configs/sama5d4_xplained_spiflash_defconfig | 1 +
include/configs/sama5d4_xplained.h | 56 ++++++++++++++++
6 files changed, 145 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 091d615..9c43255 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -514,6 +514,7 @@ config TARGET_SAMA5D3XEK
config TARGET_SAMA5D4_XPLAINED
bool "Support sama5d4_xplained"
select CPU_V7
+ select SUPPORT_SPL
config TARGET_SAMA5D4EK
bool "Support sama5d4ek"
diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
index 93bebd4..d64d320 100644
--- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c
+++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
@@ -10,6 +10,7 @@
#include <asm/arch/at91_common.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/at91_rstc.h>
+#include <asm/arch/atmel_mpddrc.h>
#include <asm/arch/atmel_usba_udc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/clk.h>
@@ -328,3 +329,87 @@ int board_eth_init(bd_t *bis)
return rc;
}
+
+/* SPL */
+#ifdef CONFIG_SPL_BUILD
+void spl_board_init(void)
+{
+#ifdef CONFIG_SYS_USE_MMC
+ sama5d4_xplained_mci1_hw_init();
+#elif CONFIG_SYS_USE_NANDFLASH
+ sama5d4_xplained_nand_hw_init();
+#elif CONFIG_SYS_USE_SERIALFLASH
+ sama5d4_xplained_spi0_hw_init();
+#endif
+}
+
+static void ddr2_conf(struct atmel_mpddr *ddr2)
+{
+ ddr2->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
+
+ ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
+ ATMEL_MPDDRC_CR_NR_ROW_14 |
+ ATMEL_MPDDRC_CR_CAS_DDR_CAS3 |
+ ATMEL_MPDDRC_CR_NB_8BANKS |
+ ATMEL_MPDDRC_CR_NDQS_DISABLED |
+ ATMEL_MPDDRC_CR_DECOD_INTERLEAVED |
+ ATMEL_MPDDRC_CR_UNAL_SUPPORTED);
+
+ ddr2->rtr = 0x2b0;
+
+ ddr2->tpr0 = (8 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TWR_OFFSET |
+ 10 << ATMEL_MPDDRC_TPR0_TRC_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR0_TRP_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET);
+
+ ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET |
+ 200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
+ 25 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
+ 23 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
+
+ ddr2->tpr2 = (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
+ 3 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
+ 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
+}
+
+void mem_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ struct atmel_mpddr ddr2;
+
+ ddr2_conf(&ddr2);
+
+ /* enable MPDDR clock */
+ at91_periph_clk_enable(ATMEL_ID_MPDDRC);
+ writel(0x4, &pmc->scer);
+
+ /* DDRAM2 Controller initialize */
+ ddr2_init(ATMEL_BASE_DDRCS, &ddr2);
+}
+
+void at91_pmc_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+ u32 tmp;
+
+ tmp = AT91_PMC_PLLAR_29 |
+ AT91_PMC_PLLXR_PLLCOUNT(0x3f) |
+ AT91_PMC_PLLXR_MUL(87) |
+ AT91_PMC_PLLXR_DIV(1);
+ at91_plla_init(tmp);
+
+ writel(0x0 << 8, &pmc->pllicpr);
+
+ tmp = AT91_PMC_MCKR_H32MXDIV |
+ AT91_PMC_MCKR_PLLADIV_2 |
+ AT91_PMC_MCKR_MDIV_3 |
+ AT91_PMC_MCKR_CSS_PLLA;
+ at91_mck_init(tmp);
+}
+#endif
diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig
index 3720f3c..73df28c 100644
--- a/configs/sama5d4_xplained_mmc_defconfig
+++ b/configs/sama5d4_xplained_mmc_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
diff --git a/configs/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig
index 5e13da7..046fe06 100644
--- a/configs/sama5d4_xplained_nandflash_defconfig
+++ b/configs/sama5d4_xplained_nandflash_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
diff --git a/configs/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig
index 3a4607c..755dd8b 100644
--- a/configs/sama5d4_xplained_spiflash_defconfig
+++ b/configs/sama5d4_xplained_spiflash_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
+S:CONFIG_ARM=y
+S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index 996973d..6d70bc9 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -20,7 +20,9 @@
#define CONFIG_ARCH_CPU_INIT
+#ifndef CONFIG_SPL_BUILD
#define CONFIG_SKIP_LOWLEVEL_INIT
+#endif
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_DISPLAY_CPUINFO
@@ -66,8 +68,12 @@
#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
#define CONFIG_SYS_SDRAM_SIZE 0x20000000
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_INIT_SP_ADDR 0x210000
+#else
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
+#endif
#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
@@ -221,4 +227,54 @@
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
+
+/* SPL */
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_TEXT_BASE 0x200000
+#define CONFIG_SPL_MAX_SIZE 0x10000
+#define CONFIG_SPL_BSS_START_ADDR 0x20000000
+#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
+#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+
+#define CONFIG_SPL_BOARD_INIT
+#define CONFIG_SYS_MONITOR_LEN (512 << 10)
+
+#ifdef CONFIG_SYS_USE_MMC
+#define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+
+#elif CONFIG_SYS_USE_NANDFLASH
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_DRIVERS
+#define CONFIG_SPL_NAND_BASE
+#define CONFIG_PMECC_CAP 8
+#define CONFIG_PMECC_SECTOR_SIZE 512
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_SIZE 0x1000
+#define CONFIG_SYS_NAND_PAGE_COUNT 64
+#define CONFIG_SYS_NAND_OOBSIZE 224
+#define CONFIG_SYS_NAND_BLOCK_SIZE 0x40000
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
+#define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
+
+#elif CONFIG_SYS_USE_SERIALFLASH
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
+
+#endif
#endif
--
2.1.0.24.g4109c28
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support
2014-12-08 6:09 ` [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support Bo Shen
@ 2014-12-10 21:35 ` Robert Nelson
2014-12-11 1:21 ` Bo Shen
0 siblings, 1 reply; 19+ messages in thread
From: Robert Nelson @ 2014-12-10 21:35 UTC (permalink / raw)
To: u-boot
On Mon, Dec 8, 2014 at 12:09 AM, Bo Shen <voice.shen@atmel.com> wrote:
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
>
> arch/arm/Kconfig | 1 +
> board/atmel/sama5d4_xplained/sama5d4_xplained.c | 85 +++++++++++++++++++++++++
> configs/sama5d4_xplained_mmc_defconfig | 1 +
> configs/sama5d4_xplained_nandflash_defconfig | 1 +
> configs/sama5d4_xplained_spiflash_defconfig | 1 +
> include/configs/sama5d4_xplained.h | 56 ++++++++++++++++
> 6 files changed, 145 insertions(+)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 091d615..9c43255 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -514,6 +514,7 @@ config TARGET_SAMA5D3XEK
> config TARGET_SAMA5D4_XPLAINED
> bool "Support sama5d4_xplained"
> select CPU_V7
> + select SUPPORT_SPL
>
> config TARGET_SAMA5D4EK
> bool "Support sama5d4ek"
> diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
> index 93bebd4..d64d320 100644
> --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c
> +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
> @@ -10,6 +10,7 @@
> #include <asm/arch/at91_common.h>
> #include <asm/arch/at91_pmc.h>
> #include <asm/arch/at91_rstc.h>
> +#include <asm/arch/atmel_mpddrc.h>
> #include <asm/arch/atmel_usba_udc.h>
> #include <asm/arch/gpio.h>
> #include <asm/arch/clk.h>
> @@ -328,3 +329,87 @@ int board_eth_init(bd_t *bis)
>
> return rc;
> }
> +
> +/* SPL */
> +#ifdef CONFIG_SPL_BUILD
> +void spl_board_init(void)
> +{
> +#ifdef CONFIG_SYS_USE_MMC
> + sama5d4_xplained_mci1_hw_init();
> +#elif CONFIG_SYS_USE_NANDFLASH
> + sama5d4_xplained_nand_hw_init();
> +#elif CONFIG_SYS_USE_SERIALFLASH
> + sama5d4_xplained_spi0_hw_init();
> +#endif
> +}
> +
> +static void ddr2_conf(struct atmel_mpddr *ddr2)
> +{
> + ddr2->md = (ATMEL_MPDDRC_MD_DBW_32_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
> +
> + ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
> + ATMEL_MPDDRC_CR_NR_ROW_14 |
> + ATMEL_MPDDRC_CR_CAS_DDR_CAS3 |
> + ATMEL_MPDDRC_CR_NB_8BANKS |
> + ATMEL_MPDDRC_CR_NDQS_DISABLED |
> + ATMEL_MPDDRC_CR_DECOD_INTERLEAVED |
> + ATMEL_MPDDRC_CR_UNAL_SUPPORTED);
> +
> + ddr2->rtr = 0x2b0;
> +
> + ddr2->tpr0 = (8 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |
> + 3 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |
> + 3 << ATMEL_MPDDRC_TPR0_TWR_OFFSET |
> + 10 << ATMEL_MPDDRC_TPR0_TRC_OFFSET |
> + 3 << ATMEL_MPDDRC_TPR0_TRP_OFFSET |
> + 2 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET |
> + 2 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET |
> + 2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET);
> +
> + ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET |
> + 200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
> + 25 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
> + 23 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
> +
> + ddr2->tpr2 = (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET |
> + 2 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
> + 3 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
> + 2 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
> + 8 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
> +}
> +
> +void mem_init(void)
> +{
> + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> + struct atmel_mpddr ddr2;
> +
> + ddr2_conf(&ddr2);
> +
> + /* enable MPDDR clock */
> + at91_periph_clk_enable(ATMEL_ID_MPDDRC);
> + writel(0x4, &pmc->scer);
> +
> + /* DDRAM2 Controller initialize */
> + ddr2_init(ATMEL_BASE_DDRCS, &ddr2);
> +}
> +
> +void at91_pmc_init(void)
> +{
> + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> + u32 tmp;
> +
> + tmp = AT91_PMC_PLLAR_29 |
> + AT91_PMC_PLLXR_PLLCOUNT(0x3f) |
> + AT91_PMC_PLLXR_MUL(87) |
> + AT91_PMC_PLLXR_DIV(1);
> + at91_plla_init(tmp);
> +
> + writel(0x0 << 8, &pmc->pllicpr);
> +
> + tmp = AT91_PMC_MCKR_H32MXDIV |
> + AT91_PMC_MCKR_PLLADIV_2 |
> + AT91_PMC_MCKR_MDIV_3 |
> + AT91_PMC_MCKR_CSS_PLLA;
> + at91_mck_init(tmp);
> +}
> +#endif
> diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig
> index 3720f3c..73df28c 100644
> --- a/configs/sama5d4_xplained_mmc_defconfig
> +++ b/configs/sama5d4_xplained_mmc_defconfig
> @@ -1,3 +1,4 @@
> +CONFIG_SPL=y
> CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_MMC"
> +S:CONFIG_ARM=y
> +S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
> diff --git a/configs/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig
> index 5e13da7..046fe06 100644
> --- a/configs/sama5d4_xplained_nandflash_defconfig
> +++ b/configs/sama5d4_xplained_nandflash_defconfig
> @@ -1,3 +1,4 @@
> +CONFIG_SPL=y
> CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_NANDFLASH"
> +S:CONFIG_ARM=y
> +S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
> diff --git a/configs/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig
> index 3a4607c..755dd8b 100644
> --- a/configs/sama5d4_xplained_spiflash_defconfig
> +++ b/configs/sama5d4_xplained_spiflash_defconfig
> @@ -1,3 +1,4 @@
> +CONFIG_SPL=y
> CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
> +S:CONFIG_ARM=y
> +S:CONFIG_TARGET_SAMA5D4_XPLAINED=y
> diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
> index 996973d..6d70bc9 100644
> --- a/include/configs/sama5d4_xplained.h
> +++ b/include/configs/sama5d4_xplained.h
> @@ -20,7 +20,9 @@
>
> #define CONFIG_ARCH_CPU_INIT
>
> +#ifndef CONFIG_SPL_BUILD
> #define CONFIG_SKIP_LOWLEVEL_INIT
> +#endif
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_DISPLAY_CPUINFO
>
> @@ -66,8 +68,12 @@
> #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
> #define CONFIG_SYS_SDRAM_SIZE 0x20000000
>
> +#ifdef CONFIG_SPL_BUILD
> +#define CONFIG_SYS_INIT_SP_ADDR 0x210000
> +#else
> #define CONFIG_SYS_INIT_SP_ADDR \
> (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
> +#endif
>
> #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
>
> @@ -221,4 +227,54 @@
> /* Size of malloc() pool */
> #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
>
> +
> +/* SPL */
> +#define CONFIG_SPL_FRAMEWORK
> +#define CONFIG_SPL_TEXT_BASE 0x200000
> +#define CONFIG_SPL_MAX_SIZE 0x10000
> +#define CONFIG_SPL_BSS_START_ADDR 0x20000000
> +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
> +#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
> +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
> +
> +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> +#define CONFIG_SPL_LIBGENERIC_SUPPORT
> +#define CONFIG_SPL_GPIO_SUPPORT
> +#define CONFIG_SPL_SERIAL_SUPPORT
> +
> +#define CONFIG_SPL_BOARD_INIT
> +#define CONFIG_SYS_MONITOR_LEN (512 << 10)
> +
> +#ifdef CONFIG_SYS_USE_MMC
> +#define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
> +#define CONFIG_SPL_MMC_SUPPORT
> +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
> +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
> +#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
Hi Bo,
You have an extra "_" there: (MMC_SD) -> (MMCSD), it should be:
#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
build error:
common/spl/spl_mmc.c: In function ?spl_mmc_load_image?:
common/spl/spl_mmc.c:135:6: error:
?CONFIG_SYS_MMCSD_FS_BOOT_PARTITION? undeclared (first use in this
function)
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
^
common/spl/spl_mmc.c:135:6: note: each undeclared identifier is
reported only once for each function it appears in
scripts/Makefile.build:275: recipe for target 'spl/common/spl/spl_mmc.o' failed
make[2]: *** [spl/common/spl/spl_mmc.o] Error 1
scripts/Makefile.spl:212: recipe for target 'spl/common/spl' failed
make[1]: *** [spl/common/spl] Error 2
make[1]: *** Waiting for unfinished jobs....
Regards,
--
Robert Nelson
http://www.rcn-ee.com/
^ permalink raw reply [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support
2014-12-08 6:09 ` [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support Bo Shen
@ 2014-12-10 21:38 ` Robert Nelson
0 siblings, 0 replies; 19+ messages in thread
From: Robert Nelson @ 2014-12-10 21:38 UTC (permalink / raw)
To: u-boot
Same here:
> +#ifdef CONFIG_SYS_USE_MMC
> +#define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
> +#define CONFIG_SPL_MMC_SUPPORT
> +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
> +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
> +#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
^^
#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
Regards,
--
Robert Nelson
http://www.rcn-ee.com/
^ permalink raw reply [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support
2014-12-10 21:35 ` Robert Nelson
@ 2014-12-11 1:21 ` Bo Shen
2014-12-11 1:29 ` Bo Shen
0 siblings, 1 reply; 19+ messages in thread
From: Bo Shen @ 2014-12-11 1:21 UTC (permalink / raw)
To: u-boot
Hi Robert Nelson,
On 12/11/2014 05:35 AM, Robert Nelson wrote:
>> +
>> >+#ifdef CONFIG_SYS_USE_MMC
>> >+#define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
>> >+#define CONFIG_SPL_MMC_SUPPORT
>> >+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
>> >+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
>> >+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
> Hi Bo,
>
> You have an extra "_" there: (MMC_SD) -> (MMCSD), it should be:
>
> #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
>
> build error:
>
> common/spl/spl_mmc.c: In function ?spl_mmc_load_image?:
> common/spl/spl_mmc.c:135:6: error:
> ?CONFIG_SYS_MMCSD_FS_BOOT_PARTITION? undeclared (first use in this
> function)
> CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
> ^
> common/spl/spl_mmc.c:135:6: note: each undeclared identifier is
> reported only once for each function it appears in
> scripts/Makefile.build:275: recipe for target 'spl/common/spl/spl_mmc.o' failed
> make[2]: *** [spl/common/spl/spl_mmc.o] Error 1
> scripts/Makefile.spl:212: recipe for target 'spl/common/spl' failed
> make[1]: *** [spl/common/spl] Error 2
> make[1]: *** Waiting for unfinished jobs....
Do you test this patch series based on u-boot master branch?
I use "git grep CONFIG_SYS_MMCSD_FS_BOOT_PARTITION", and don't find any
information about it.
Using "git grep CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION" show many files use
it. And the following commit introduced this name:
--->8---
commit 205b4f33cfe58268df7d433f2da515fe660afd9c
Author: Guillaume GARDET <guillaume.gardet@free.fr>
Date: Wed Oct 15 17:53:11 2014 +0200
Rename some defines containing FAT in their name to be filesystem
generic
Rename some defines containing FAT in their name to be filesystem
generic:
MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---8<---
>
> Regards,
>
> -- Robert Nelson http://www.rcn-ee.com/
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support
2014-12-11 1:21 ` Bo Shen
@ 2014-12-11 1:29 ` Bo Shen
2014-12-11 1:56 ` Robert Nelson
0 siblings, 1 reply; 19+ messages in thread
From: Bo Shen @ 2014-12-11 1:29 UTC (permalink / raw)
To: u-boot
Hi Robert Nelson,
On 12/11/2014 09:21 AM, Bo Shen wrote:
> Hi Robert Nelson,
>
> On 12/11/2014 05:35 AM, Robert Nelson wrote:
>>> +
>>> >+#ifdef CONFIG_SYS_USE_MMC
>>> >+#define CONFIG_SPL_LDSCRIPT
>>> arch/arm/cpu/at91-common/u-boot-spl.lds
>>> >+#define CONFIG_SPL_MMC_SUPPORT
>>> >+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
>>> >+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
>>> >+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
>> Hi Bo,
>>
>> You have an extra "_" there: (MMC_SD) -> (MMCSD), it should be:
>>
>> #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
>>
>> build error:
>>
>> common/spl/spl_mmc.c: In function ?spl_mmc_load_image?:
>> common/spl/spl_mmc.c:135:6: error:
>> ?CONFIG_SYS_MMCSD_FS_BOOT_PARTITION? undeclared (first use in this
>> function)
>> CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
>> ^
>> common/spl/spl_mmc.c:135:6: note: each undeclared identifier is
>> reported only once for each function it appears in
>> scripts/Makefile.build:275: recipe for target
>> 'spl/common/spl/spl_mmc.o' failed
>> make[2]: *** [spl/common/spl/spl_mmc.o] Error 1
>> scripts/Makefile.spl:212: recipe for target 'spl/common/spl' failed
>> make[1]: *** [spl/common/spl] Error 2
>> make[1]: *** Waiting for unfinished jobs....
>
> Do you test this patch series based on u-boot master branch?
> I use "git grep CONFIG_SYS_MMCSD_FS_BOOT_PARTITION", and don't find any
> information about it.
>
> Using "git grep CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION" show many files use
> it. And the following commit introduced this name:
> --->8---
> commit 205b4f33cfe58268df7d433f2da515fe660afd9c
> Author: Guillaume GARDET <guillaume.gardet@free.fr>
> Date: Wed Oct 15 17:53:11 2014 +0200
>
> Rename some defines containing FAT in their name to be filesystem
> generic
>
> Rename some defines containing FAT in their name to be filesystem
> generic:
> MMCSD_MODE_FAT => MMCSD_MODE_FS
> CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
> CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
> CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
> CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Tom Rini <trini@ti.com>
> ---8<---
Sorry for the noise, just now, I fetch the u-boot master branch and find
this name is changed again in the following commit:
--->8---
commit e2ccdf89a0196b40b445700670777ebee231756d
Author: Paul Kocialkowski <contact@paulk.fr>
Date: Sat Nov 8 23:14:55 2014 +0100
MMC SD fs boot partition config coding style and proper description
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION ought to be called
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to keep it consistent with other
config
options such as: CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR.
In addition, it is not related to raw mode booting but to fs mode
instead.
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@ti.com>
---8<---
Thanks, I will rebase it to u-boot latest master branch and will fix it
in v2 version.
Thanks again.
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 19+ messages in thread
* [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support
2014-12-11 1:29 ` Bo Shen
@ 2014-12-11 1:56 ` Robert Nelson
0 siblings, 0 replies; 19+ messages in thread
From: Robert Nelson @ 2014-12-11 1:56 UTC (permalink / raw)
To: u-boot
On Wed, Dec 10, 2014 at 7:29 PM, Bo Shen <voice.shen@atmel.com> wrote:
> Hi Robert Nelson,
>
>
> On 12/11/2014 09:21 AM, Bo Shen wrote:
>>
>> Hi Robert Nelson,
>>
>> On 12/11/2014 05:35 AM, Robert Nelson wrote:
>>>>
>>>> +
>>>> >+#ifdef CONFIG_SYS_USE_MMC
>>>> >+#define CONFIG_SPL_LDSCRIPT
>>>> arch/arm/cpu/at91-common/u-boot-spl.lds
>>>> >+#define CONFIG_SPL_MMC_SUPPORT
>>>> >+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
>>>> >+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
>>>> >+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
>>>
>>> Hi Bo,
>>>
>>> You have an extra "_" there: (MMC_SD) -> (MMCSD), it should be:
>>>
>>> #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
>>>
>>> build error:
>>>
>>> common/spl/spl_mmc.c: In function ?spl_mmc_load_image?:
>>> common/spl/spl_mmc.c:135:6: error:
>>> ?CONFIG_SYS_MMCSD_FS_BOOT_PARTITION? undeclared (first use in this
>>> function)
>>> CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
>>> ^
>>> common/spl/spl_mmc.c:135:6: note: each undeclared identifier is
>>> reported only once for each function it appears in
>>> scripts/Makefile.build:275: recipe for target
>>> 'spl/common/spl/spl_mmc.o' failed
>>> make[2]: *** [spl/common/spl/spl_mmc.o] Error 1
>>> scripts/Makefile.spl:212: recipe for target 'spl/common/spl' failed
>>> make[1]: *** [spl/common/spl] Error 2
>>> make[1]: *** Waiting for unfinished jobs....
>>
>>
>> Do you test this patch series based on u-boot master branch?
>> I use "git grep CONFIG_SYS_MMCSD_FS_BOOT_PARTITION", and don't find any
>> information about it.
>>
>> Using "git grep CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION" show many files use
>> it. And the following commit introduced this name:
>> --->8---
>> commit 205b4f33cfe58268df7d433f2da515fe660afd9c
>> Author: Guillaume GARDET <guillaume.gardet@free.fr>
>> Date: Wed Oct 15 17:53:11 2014 +0200
>>
>> Rename some defines containing FAT in their name to be filesystem
>> generic
>>
>> Rename some defines containing FAT in their name to be filesystem
>> generic:
>> MMCSD_MODE_FAT => MMCSD_MODE_FS
>> CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
>> CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
>> CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
>> CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
>>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Tom Rini <trini@ti.com>
>> ---8<---
>
>
> Sorry for the noise, just now, I fetch the u-boot master branch and find
> this name is changed again in the following commit:
> --->8---
> commit e2ccdf89a0196b40b445700670777ebee231756d
> Author: Paul Kocialkowski <contact@paulk.fr>
> Date: Sat Nov 8 23:14:55 2014 +0100
>
> MMC SD fs boot partition config coding style and proper description
>
> CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION ought to be called
> CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to keep it consistent with other
> config
> options such as: CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR.
>
> In addition, it is not related to raw mode booting but to fs mode
> instead.
>
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> Reviewed-by: Tom Rini <trini@ti.com>
> ---8<---
>
> Thanks, I will rebase it to u-boot latest master branch and will fix it in
> v2 version.
Ouch, i was just on master and didn't check git history... Wow two
renames of that variable in master!!!. ;)
Regards,
--
Robert Nelson
http://www.rcn-ee.com/
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2014-12-11 1:56 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 6:09 [U-Boot] [PATCH 0/13] ARM: atmel: enable spl for sama5d4 related boards Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 01/13] ARM: atmel: clock: make it possible to configure HMX32 Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 02/13] ARM: atmel: sama5: add bus matrix header file Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 03/13] ARM: atmel: sama5: add sfr register " Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 04/13] ARM: atmel: spl: add weak bus matrix init function Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 05/13] ARM: atmel: spl: add saic to aic redirect function Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 06/13] ARM: atmel: spl: can not disable osc for sama5d4 Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 07/13] ARM: atmel: sama5d4: add matrix1 base addr definition Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 08/13] ARM: atmel: sama5d4: add bus matrix init function Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 09/13] ARM: atmel: sama5d4: add interrupt redirec function Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 10/13] ARM: atmel: sama5d4: can access DDR in interleave mode Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 11/13] ARM: atmel: sama5d4: build related file when enable SPL Bo Shen
2014-12-08 6:09 ` [U-Boot] [PATCH 12/13] ARM: atmel: sama5d4ek: enable SPL support Bo Shen
2014-12-10 21:38 ` Robert Nelson
2014-12-08 6:09 ` [U-Boot] [PATCH 13/13] ARM: atmel: sama5d4_xplained: enable spl support Bo Shen
2014-12-10 21:35 ` Robert Nelson
2014-12-11 1:21 ` Bo Shen
2014-12-11 1:29 ` Bo Shen
2014-12-11 1:56 ` Robert Nelson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.