[Gen8 General] scholbert:
True external boot procedure...

Hi again,

in the meantime i made some further experiments, which are of no practical use yet.

This was just for fun and education :rolleyes:

The aim was to make my A101 booting completely from external media (MicroSD) starting from a coldboot.

This includes external bootloader as well.

You might remember that i started this thread with publishing the boot mode signals and how to change it.

Factory default mode is 0b1010001 (MMC2 USB UART3 MMC1).

Internal eMMC is first boot device.

So i prepared the board to use mode 0b1110001 (USB UART3 MMC1 MMC2)

External boot devices are first here.

I prepared a MicroSD card as boot device, matching the requirements for the OMAP and test it.

To make it short, the device finally refused to start from MMC1, because the slot is not powered up from the beginning.

So finally the bootloader came up from internal eMMC as well.

The internal logic needs to be tweaked a little bit, to power the slot from the beginning.

Maybe i'll check this out :D

EDIT:

Some background information here:

The power supply for the MicroSD slot is powered on by a 3V LDO regulator in a SOT23-5 package.

See datasheet in the attachment and refer to my pic in the next post!

This LDO is enabled by OMAP signal GPIO158, which belongs to GPIO5 unit.

By using a memdump tool at memory space 0x4905603c you can directly observe what's happening.

At low level if a card is inserted (powered on -> 0xE001000) or ejected (powered off -> 0xA0010000)

This indicates that high level at GPIO_158 triggers the logic to power on the card.

Of course this process is covered by kernel code:

sd_power -> GPIO_158	(bit 30 of GPIO5 unit)

Hardware works

To permanently power the slot... i need to:

A. pull enable input of the LDO to high level directly after reset

After reset most GPIO's are in high-z mode, the enable input is already pulled by a 1K resistor to a 1.8V power domain, but unfortunately this domain is not powered directly after reset.

To circumvent this behaviour the enable input of the LDO should be pulled to the 3.3V domain, which is powered up immediately.

B. bridge Input and Output of the LDO with a resistor

This method might cause some trouble on A101IT, becuase the LDO will be simply brigded and power the external slot with 3.3V.

Both methods will obviously disable the power sequencing for MMC1.

The card will be permantly powered by the 3.3V power domain.

So you might get into trouble with the hot-plug functionality while running Android.

On the stock setup the sd_power signal is used to power up the card properly during hot-plug.

Again, this will be disabled with the hardware hack.

Software works

Both methods will need some tweaks in the bootcode to initialize MMC1 slot first.

It might be necessary as well to tell the kernel (modified one for external boot) that the card is always powered.

static struct regulator_init_data board_vmmc_ext = {
.constraints = {
.name	= "vmmc",
.min_uV	= 3000000,
.max_uV	= 3000000,
.valid_modes_mask	= REGULATOR_MODE_NORMAL,
-	.always_on	= 0,
-	.boot_on	= 0,
+	.always_on	= 1,
+	.boot_on	= 1,
},
.num_consumer_supplies	= 1,
.consumer_supplies	= &board_vmmc_ext_supply,
};

TBC...

EDIT

I found out that the card is not detected at early boot, because the pull-up to the 1.8V domain is not powered.

We'll definitely have to tweak the enable input of the LDO to be connected to a power domain which is powered up directly after reset.

See discription above.

That's it for now... as stated this was just for fun and i guess only a few know what the hell i am talking about.

Take care of yourself!

scholbert