Skip to contentSkip to conversation

cm-fx6 updates

PATCH Superseded Nikita Kiryanov 3 participants 7 messages Oct 29, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover cm-fx6 updates

This patchset contains a bug fix for DRAM detection, support for Phison SSD, and a new preboot hook.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>

Nikita Kiryanov (3):
arm: mx6: cm_fx6: change issd gpio order
arm: mx6: cm_fx6: detect 1GB DRAM correctly on solo
common: introduce board_preboot_os hook

 board/compulab/cm_fx6/cm_fx6.c | 7 ++++++-
 board/compulab/cm_fx6/spl.c    | 7 ++++---
 common/bootm_os.c              | 7 +++++++
 3 files changed, 17 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 arm: mx6: cm_fx6: change issd gpio order

Change the order in which GPIOs are toggled in SATA init sequence to accomodate both SanDisk and Phison SSDs.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/compulab/cm_fx6/cm_fx6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/compulab/cm_fx6/cm_fx6.c +1 -1
index 82681b1..0206ae8 100644
@@ -31,12 +31,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_DWC_AHSATA
 static int cm_fx6_issd_gpios[] = {
 	/* The order of the GPIOs in the array is important! */
+	CM_FX6_SATA_LDO_EN,
 	CM_FX6_SATA_PHY_SLP,
 	CM_FX6_SATA_NRSTDLY,
 	CM_FX6_SATA_PWREN,
 	CM_FX6_SATA_NSTANDBY1,
 	CM_FX6_SATA_NSTANDBY2,
-	CM_FX6_SATA_LDO_EN,
 };
 
 static void cm_fx6_sata_power(int on)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 arm: mx6: cm_fx6: detect 1GB DRAM correctly on solo

In reply to Nikita Kiryanov

The 1GB DRAM configuration on mx6 solo uses 2 chip selects, but the code tests 1GB DRAM configuration as if it is all present on one chip select, and thus cannot see the full range of available memory.

Refactor the check to detect 1GB DRAM correctly.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/compulab/cm_fx6/spl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
board/compulab/cm_fx6/spl.c +4 -3
index 3948ba2..6fe937b 100644
@@ -235,10 +235,11 @@ static int cm_fx6_spl_dram_init(void)
 
 		spl_mx6s_dram_init(DDR_32BIT_1GB, false);
 		bank1_size = get_ram_size((long int *)PHYS_SDRAM_1, 0x80000000);
-		if (bank1_size == 0x40000000)
-			return 0;
-
+		bank2_size = get_ram_size((long int *)PHYS_SDRAM_2, 0x80000000);
 		if (bank1_size == 0x20000000) {
+			if (bank2_size == 0x20000000)
+				return 0;
+
 			spl_mx6s_dram_init(DDR_32BIT_512MB, true);
 			return 0;
 		}
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 common: introduce board_preboot_os hook

In reply to Nikita Kiryanov

Introduce board specific function board_preboot_os() to allow for board specific config before we boot, and use it on cm_fx6 to power off sata so that Linux will be able to setup it correctly.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 board/compulab/cm_fx6/cm_fx6.c | 5 +++++
 common/bootm_os.c              | 7 +++++++
 2 files changed, 12 insertions(+)
board/compulab/cm_fx6/cm_fx6.c +5 -0
index 0206ae8..b44ee9d 100644
@@ -125,6 +125,11 @@ int sata_initialize(void)
 
 	return err;
 }
+
+void board_preboot_os(void)
+{
+	cm_fx6_sata_power(0);
+}
 #else
 static int cm_fx6_setup_issd(void) { return 0; }
 #endif
common/bootm_os.c +7 -0
index 5be4467..95cd657 100644
@@ -442,10 +442,17 @@ __weak void arch_preboot_os(void)
 	/* please define platform specific arch_preboot_os() */
 }
 
+/* Allow for board specific config before we boot */
+__weak void board_preboot_os(void)
+{
+	/* please define board specific board_preboot_os() */
+}
+
 int boot_selected_os(int argc, char * const argv[], int state,
 		     bootm_headers_t *images, boot_os_fn *boot_fn)
 {
 	arch_preboot_os();
+	board_preboot_os();
 	boot_fn(state, argc, argv, images);
 
 	/* Stand-alone may return when 'autostart' is 'no' */
Signature · 1 line
1.9.1
#4 lore raw

PATCH 3/3 common: introduce board_preboot_os hook

Hello Nikita,

Quoted 8 lines · Nikita Kiryanov

Introduce board specific function board_preboot_os() to allow for board specific config before we boot, and use it on cm_fx6 to power off sata so that Linux will be able to setup it correctly.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>

..

Quoted 8 lines
common/bootm_os.c +7 -0
+
+void board_preboot_os(void)
+{
+	cm_fx6_sata_power(0);
+}
 
+/* Allow for board specific config before we boot */
+__weak void board_preboot_os(void)

common/bootm_os.c __weak void arch_preboot_os(void) · line 456

Quoted 10 lines
common/bootm_os.c +5 -0
+{
+	/* please define board specific board_preboot_os() */
+}
+
  int boot_selected_os(int argc, char * const argv[], int state,
  		     bootm_headers_t *images, boot_os_fn *boot_fn)
  {
  	arch_preboot_os();
+	board_preboot_os();
  	boot_fn(state, argc, argv, images);

Can you also add a prototype for the board_preboot_os in say bootm.h or similiar and make sure those headers are included. (it will warn otherwise with W=1).

Regards, Jeroen

#5 lore raw

PATCH 3/3 common: introduce board_preboot_os hook

Quoted 27 lines · Jeroen Hofstee
Quoted 9 lines · Nikita Kiryanov

Introduce board specific function board_preboot_os() to allow for board specific config before we boot, and use it on cm_fx6 to power off sata so that Linux will be able to setup it correctly.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>

..

Quoted 15 lines
common/bootm_os.c +10 -0
+
+void board_preboot_os(void)
+{
+       cm_fx6_sata_power(0);
+}
  +/* Allow for board specific config before we boot */
+__weak void board_preboot_os(void)
+{
+       /* please define board specific board_preboot_os() */
+}
+
  int boot_selected_os(int argc, char * const argv[], int state,
                     bootm_headers_t *images, boot_os_fn *boot_fn)
  {
Quoted 8 lines
Quoted 3 lines
        arch_preboot_os();
+       board_preboot_os();
        boot_fn(state, argc, argv, images);

Can you also add a prototype for the board_preboot_os in say bootm.h or similiar and make sure those headers are included. (it will warn otherwise with W=1).

and also split the patch in two.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#6 lore raw

PATCH 3/3 common: introduce board_preboot_os hook

Hi Jeroen, Otavio,

Quoted 28 lines · Otavio Salvador
Quoted 27 lines · Jeroen Hofstee
Quoted 9 lines · Nikita Kiryanov

Introduce board specific function board_preboot_os() to allow for board specific config before we boot, and use it on cm_fx6 to power off sata so that Linux will be able to setup it correctly.

Cc Igor Grinberg <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>

..

Quoted 15 lines
common/bootm_os.c +10 -0
+
+void board_preboot_os(void)
+{
+       cm_fx6_sata_power(0);
+}
   +/* Allow for board specific config before we boot */
+__weak void board_preboot_os(void)
+{
+       /* please define board specific board_preboot_os() */
+}
+
   int boot_selected_os(int argc, char * const argv[], int state,
                      bootm_headers_t *images, boot_os_fn *boot_fn)
   {
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
         arch_preboot_os();
+       board_preboot_os();
         boot_fn(state, argc, argv, images);

Can you also add a prototype for the board_preboot_os in say bootm.h or similiar and make sure those headers are included. (it will warn otherwise with W=1).

Sure.

Quoted 2 lines

and also split the patch in two.

Alright.

Signature · 2 lines
Regards,
Nikita Kiryanov