Help with SIP package booting

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

ap28gorilla
Posts: 2
Joined: Thu Apr 11, 2019 2:03 pm

Help with SIP package booting

Thu Aug 13, 2020 2:36 am

I am working on a new board using the SAM9x60D5M processor, configured similarly to the evaluation board for the SAM9X60 (although I know this is not the SIP). I am maybe looking for some general guidance here, but I'm flashing to the NAND flash, I'm using the same flash as the eval board except it is the BGA package as opposed to the TSOP package on the evaluation board.

I know with the D5M SIP there is small DDR2, so I (for now) modified the SAM9x60ek board c file to update it for the configuration of the RAM in the cells (below is my diff):

Code: Select all

diff --git a/board/sam9x60ek/sam9x60ek.c b/board/sam9x60ek/sam9x60ek.c
index 1dd7694..e548df4 100644
--- a/board/sam9x60ek/sam9x60ek.c
+++ b/board/sam9x60ek/sam9x60ek.c
@@ -77,14 +77,14 @@ static void initialize_dbgu(void)
 
 static void ddramc_reg_config(struct ddramc_register *ddramc_config)
 {
-	ddramc_config->mdr = (AT91C_DDRC2_DBW_16_BITS |
+	ddramc_config->mdr = (AT91C_DDRC2_DBW_16_BITS | // 16 bits
 				AT91C_DDRC2_MD_DDR2_SDRAM);
 
-	ddramc_config->cr = (AT91C_DDRC2_NC_DDR10_SDR9 |
-				AT91C_DDRC2_NR_14 |
+	ddramc_config->cr = (AT91C_DDRC2_NC_DDR10_SDR9 |  // number of colums, 1024
+				AT91C_DDRC2_NR_13 | // number of rows, 8192
 				AT91C_DDRC2_CAS_3 |
 				AT91C_DDRC2_WEAK_STRENGTH_RZQ7 |
-				AT91C_DDRC2_NB_BANKS_8 |
+				AT91C_DDRC2_NB_BANKS_4 | // 4 memmory banks
 				AT91C_DDRC2_DECOD_INTERLEAVED |
 				AT91C_DDRC2_UNAL_SUPPORTED);
I get the at91bootstrap to run and hand off to uboot, but this is where I get stuck. I'm starting to trace through as best I can to see where I am going wrong. Here is my output on the console:
RomBOOT


AT91Bootstrap 3.9.2 (Wed 12 Aug 2020 03:11:47 PM PDT)

EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName

EEPROM: Using default information

EEPROM: Board sn: 0x11500000 revision: 0x0

NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xdc
NAND: Page Bytes: 4096, Spare Bytes: 224
NAND: ECC Correctability Bits: 8, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 8, sector: 512
NAND: Image: Copy 0xc0000 bytes from 0x40000 to 0x23f00000
NAND: Done to load image
<debug_uart>

U-Boot 2020.01-linux4sam-2020.04 (Aug 12 2020 - 17:06:57 -0700)

CPU: Unknown CPU type
Crystal frequency: 24 MHz
CPU clock : 600 MHz
Master clock : 200 MHz
DRAM: 64 MiB
AWP: Done with board_f.c init
The last line about AWP: Done with board_f.c init is my marker I added to see if it hangs. The Unknown CPU type I have determined to be because the SIP processor returns 1 instead of zero (but cpu_is_sam9x60() is true):

Code: Select all

char *get_cpu_name(void)
{
	unsigned int extension_id = get_extension_chip_id();

	if (cpu_is_sam9x60()) {
		switch (extension_id) {
		case ARCH_EXID_SAM9X60:
			return "SAM9X60";
		default:
			return "Unknown CPU type";  // goes here because SIP seems to have EXID of 1 instead of zero?
		}
	} else {
		return "Unknown CPU type";
	}
}
but the DRAM seems small as well. Basically, if anyone can help my be pointed in the right direction, that would be great. Appreciate any help or feedback....
blue_z
Location: USA
Posts: 2115
Joined: Thu Apr 19, 2007 10:15 pm

Re: Help with SIP package booting

Fri Aug 14, 2020 12:21 am

ap28gorilla wrote: ... I (for now) modified the SAM9x60ek board c file to update it for the configuration of the RAM in the cells (below is my diff):

Code: Select all

diff --git a/board/sam9x60ek/sam9x60ek.c b/board/sam9x60ek/sam9x60ek.c
index 1dd7694..e548df4 100644
--- a/board/sam9x60ek/sam9x60ek.c
+++ b/board/sam9x60ek/sam9x60ek.c
...
If you going to describe source code modules and/or present code patches, then you need to explicitly mention exactly what program or project that code belongs to.
Do not make the reader guess what you are referring to.

ap28gorilla wrote: I know with the D5M SIP there is small DDR2 ...
...
... the DRAM seems small as well.
You claim to be aware that there is a reduction in memory size, but neglect to quantify what that reduction is as a numeric value.
You show a patch for one routine in AT91Bootstrap for a different DRAM capacity, but neglect to mention (or did not make?) any other changes.
Reusing the software configuration of one board for another board with less memory is going to require more than just one patch to one boot program.
Every piece of software, i.e. AT91Bootstrap, U-Boot, and the Linux kernel (via Device Tree), needs to be aware of the correct memory size.

The symptom of U-Boot wandering off is plausible when it is configured for more memory than the actual available RAM.
Memory reduction also requires a review of boot procedures using a memory map to ensure that programs/images are loaded into locations with physical RAM and do not overlap each other.

Regards
ap28gorilla
Posts: 2
Joined: Thu Apr 11, 2019 2:03 pm

Re: Help with SIP package booting

Fri Aug 14, 2020 2:13 am

I appreciate the pointers. I am clear on how to change it in at91bootstrap but I’m not clear on how to change the available memory in uboot. Do you have any pointers? I’ve looked in the board c files but don’t see anything there, looks like uboot does a memory size check taking the maximum memory as input. I’ve lowered that, to no avail.

I’ll go back and dig in, just hoping if you had any pointers on uboot that would be helpful. If not I’ll keep at it.
blue_z
Location: USA
Posts: 2115
Joined: Thu Apr 19, 2007 10:15 pm

Re: Help with SIP package booting

Sat Aug 15, 2020 1:13 am

ap28gorilla wrote: I appreciate the pointers.
So what have you done with them?
Did you make any memory maps?
You still have not quantified exactly what you want/need to do, so you're ignoring that "pointer".


ap28gorilla wrote: I am clear on how to change it in at91bootstrap ...
What is this "it"?
I'm not convinced that you have made all necessary changes.

ap28gorilla wrote: ... but I’m not clear on how to change the available memory in uboot. Do you have any pointers?
Study the README file in the U-Boot source, especially the sections titled "Building the Software" and "U-Boot Porting Guide".
If you actually follow-through on the directions for porting U-Boot to your hardware platform (which is described in both of those sections), then you would learn that "looking in the board c files" is misguided.
There's also information on spelling.

Regards

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 10 guests