shibajee/u-boot_mod

It's possible to add new SPI flash support?

Closed this issue · 1 comments

I am trying to boot u-boot from a SPI Flash memory on MT7621, the memory is an EON EN25QH16-104GIP. Manufacturer ID: 1c, DeviceID: 70 15. It has 32 blocks of 64Kbytes (2MiB).

I have tried adding the following line to the drivers/spi_flash.c file:

{"EN25F16", 0x1c, 0x31151c31, 64 * 1024, 32, 0},
++ {"EN25QH16", 0x1c, 0x70151c70, 64 * 1024, 32, 0},
{"EN25Q32B", 0x1c, 0x30161c30, 64 * 1024, 64, 0},

I think the information of the chip is correct, but i don't know if adding it to that file is enough.

I have compiled and written it to memory, but there is no output in serial console. The memory is not yet soldered directly on the board, it is soldered with 5-7cm wires. Could this be the problem or have i forgotten something?

Solved. The problem was that my device uses two SPI Chip Selects (CS0 and CS1), as it comes with two types of memory. CS0 is associated with TSOP48 PCB NAND pads, and CS1 with SOP8 SPI NOR Flash.

By default it loads from NAND. I changed the MT7621 boot strapping pins from 1010 (boot from NAND 2K pages + 128B spare) to 0010 (boot from 3-byte SPI) but couldn't get u-boot from SPI. The cause was that the SoC enables CS0 to boot, and SPI CS# pin1 was on CS1. I have changed it to pin 9 on the NAND pads (ND_CE, or CS0) and it has loaded u-boot and output serial console.

Sorry for the confusion.

PS: The device is Ubiquiti EdgeRouter X with 256MiB NAND (damaged and removed) and 2MiB SPI Flash. I want to solder a 16MiB flash for revive device with custom OpenWRT, but first i wanted to prove that it is capable of booting from SPI. Default boot strapping is 1010 for units with Spansion NAND chips (2K+128) and 0001 for others with Macronix (2K+64).

Bootstrap pins founds on board:

RTS2_N: R105 (Pull-down to GND) - R104 (Pull-up to 3.3v).

RTS3_N: R109 (Pull-down to GND) - R108 (Pull-up to 3.3v).

TXD1: R107 (Pull-down to GND) - R106 (Pull-up to 3.3v).

GPIO0: R111 (Pull-down to GND) - R110 (Pull-up to 3.3v).

On Spansion units R104, R109, R106 and R111 are populated with 4.7kOhm. The others are open, this sets RTS2_N to 1, RTS3_N to 0, TXD1 to 1, and GPIO0 to 0.

On Macronix units R105, R109, R107 and R110 are populated. This set 0001.

For SPI boot we need 0010. R105, R109, R106 and R111 need to be populated.

On Spansion only we need to change resistor from R104 to R105. On Macronix we need to change R107 to R106 and R110 to R111.

I write it in case it helps for someone.