imx233: move the freescale partition handling to its own file

The freescale firmware partitions has a lots of quirks that
need to be dealt with, so do it the proper way.

Change-Id: I8a5bd3fb462a4df143bc6c931057f3ffedd4b3d3
This commit is contained in:
Amaury Pouly 2012-05-19 13:33:45 +02:00
parent 61b129ac1e
commit 07138ba2ba
5 changed files with 133 additions and 36 deletions

View file

@ -40,6 +40,8 @@
#include "fmradio_i2c.h"
#include "version.h"
#include "powermgmt.h"
#include "partitions-imx233.h"
#include "adc-imx233.h"
#include "usb.h"
@ -84,6 +86,7 @@ static void usb_mode(int connect_timeout)
printf("Bootloader USB mode");
/* Enable power management to charge */
powermgmt_init();
adc_init();
usb_acknowledge(SYS_USB_CONNECTED_ACK);
@ -101,6 +104,14 @@ static void usb_mode(int connect_timeout)
info.state == TOPOFF ? "topoff" :
info.state == CHARGING ? "charging" : "<unknown>");
lcd_putsf(0, 8, "Battery: %d%%", battery_level());
lcd_putsf(0, 9, "Die temp: %d°C [%d, %d]",
adc_read(ADC_DIE_TEMP), IMX233_DIE_TEMP_HIGH,
IMX233_DIE_TEMP_LOW);
#ifdef ADC_BATT_TEMP
lcd_putsf(0, 10, "Batt temp: %d [%d, %d]",
adc_read(ADC_BATT_TEMP), IMX233_BATT_TEMP_HIGH,
IMX233_BATT_TEMP_LOW);
#endif
lcd_update();
}
}
@ -137,19 +148,15 @@ void main(uint32_t arg, uint32_t addr)
button_init();
//button_debug_screen();
printf("Boot version: %s", RBVERSION);
printf("arg=%x addr=%x", arg, addr);
printf("power up source: %x", __XTRACT(HW_POWER_STS, PWRUP_SOURCE));
#ifdef SANSA_FUZEPLUS
extern void imx233_mmc_disable_window(void);
if(arg == 0xfee1dead)
{
printf("Disable MMC window.");
imx233_mmc_disable_window();
printf("Disable partitions window.");
imx233_partitions_enable_window(false);
}
#endif
ret = storage_init();
if(ret < 0)