diff mbox series

[U-Boot] ls1012afrwy: Add ls1012afrwy revC board support.

Message ID 20180814041955.6743-1-pramod.kumar_1@nxp.com
State Accepted
Commit 1deae0c439550d1721aa14c40f49e38b7b1b4c9b
Delegated to: York Sun
Headers show
Series [U-Boot] ls1012afrwy: Add ls1012afrwy revC board support. | expand

Commit Message

Pramod Kumar Aug. 14, 2018, 4:19 a.m. UTC
ls1012afrwy support three revisions of the board.
512MB revA, revB boards and 1GB revC board.
revision A and B board are collectively identified as revA/B,
however revision C board is identifies as revC.

Signed-off-by: Pramod Kumar <pramod.kumar_1@nxp.com>
---
 board/freescale/ls1012afrdm/ls1012afrdm.c | 20 ++++++++++++--------
 include/configs/ls1012afrwy.h             |  6 +++---
 2 files changed, 15 insertions(+), 11 deletions(-)

Comments

York Sun Sept. 28, 2018, 3:42 p.m. UTC | #1
On 08/13/2018 09:19 PM, Pramod Kumar wrote:
> ls1012afrwy support three revisions of the board.
> 512MB revA, revB boards and 1GB revC board.
> revision A and B board are collectively identified as revA/B,
> however revision C board is identifies as revC.
> 
> Signed-off-by: Pramod Kumar <pramod.kumar_1@nxp.com>
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
diff mbox series

Patch

diff --git a/board/freescale/ls1012afrdm/ls1012afrdm.c b/board/freescale/ls1012afrdm/ls1012afrdm.c
index 315da8b866..5db1027717 100644
--- a/board/freescale/ls1012afrdm/ls1012afrdm.c
+++ b/board/freescale/ls1012afrdm/ls1012afrdm.c
@@ -24,11 +24,15 @@  DECLARE_GLOBAL_DATA_PTR;
 
 static inline int get_board_version(void)
 {
-	struct ccsr_gpio *pgpio = (void *)(GPIO1_BASE_ADDR);
-	int val;
+	uint32_t val;
+#ifdef CONFIG_TARGET_LS1012AFRDM
+	val = 0;
+#else
+	struct ccsr_gpio *pgpio = (void *)(GPIO2_BASE_ADDR);
 
-	val = in_be32(&pgpio->gpdat);
+	val = in_be32(&pgpio->gpdat) & BOARD_REV_MASK;/*Get GPIO2 11,12,14*/
 
+#endif
 	return val;
 }
 
@@ -46,11 +50,11 @@  int checkboard(void)
 	puts("Version");
 
 	switch (rev) {
-	case BOARD_REV_A:
-		puts(": RevA ");
+	case BOARD_REV_A_B:
+		puts(": RevA/B ");
 		break;
-	case BOARD_REV_B:
-		puts(": RevB ");
+	case BOARD_REV_C:
+		puts(": RevC ");
 		break;
 	default:
 		puts(": unknown");
@@ -100,7 +104,7 @@  int dram_init(void)
 #ifdef CONFIG_TARGET_LS1012AFRWY
 	board_rev = get_board_version();
 
-	if (board_rev & BOARD_REV_B) {
+	if (board_rev == BOARD_REV_C) {
 		mparam.mdctl = 0x05180000;
 		gd->ram_size = SYS_SDRAM_SIZE_1024;
 	} else {
diff --git a/include/configs/ls1012afrwy.h b/include/configs/ls1012afrwy.h
index 35578c3e41..b03d18bb70 100644
--- a/include/configs/ls1012afrwy.h
+++ b/include/configs/ls1012afrwy.h
@@ -9,9 +9,9 @@ 
 #include "ls1012a_common.h"
 
 /* Board Rev*/
-#define BOARD_REV_A			0x0
-#define BOARD_REV_B			0x200
-
+#define BOARD_REV_A_B			0x0
+#define BOARD_REV_C			0x00080000
+#define BOARD_REV_MASK			0x001A0000
 /* DDR */
 #define CONFIG_DIMM_SLOTS_PER_CTLR	1
 #define CONFIG_CHIP_SELECTS_PER_CTRL	1