summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 13:33:45 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 16:10:52 +0200
commit07138ba2ba08ce586486baab081aa455eb021fea (patch)
tree5a751693228edaa964e2212528e0b41c06ccc553 /bootloader
parent61b129ac1e41014fc5da846c48a361c7ec752d76 (diff)
downloadrockbox-07138ba2ba08ce586486baab081aa455eb021fea.tar.gz
rockbox-07138ba2ba08ce586486baab081aa455eb021fea.zip
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
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/imx233.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index 6d356b9cce..c1ab4893c3 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -40,6 +40,8 @@
40#include "fmradio_i2c.h" 40#include "fmradio_i2c.h"
41#include "version.h" 41#include "version.h"
42#include "powermgmt.h" 42#include "powermgmt.h"
43#include "partitions-imx233.h"
44#include "adc-imx233.h"
43 45
44#include "usb.h" 46#include "usb.h"
45 47
@@ -84,6 +86,7 @@ static void usb_mode(int connect_timeout)
84 printf("Bootloader USB mode"); 86 printf("Bootloader USB mode");
85 /* Enable power management to charge */ 87 /* Enable power management to charge */
86 powermgmt_init(); 88 powermgmt_init();
89 adc_init();
87 90
88 usb_acknowledge(SYS_USB_CONNECTED_ACK); 91 usb_acknowledge(SYS_USB_CONNECTED_ACK);
89 92
@@ -101,6 +104,14 @@ static void usb_mode(int connect_timeout)
101 info.state == TOPOFF ? "topoff" : 104 info.state == TOPOFF ? "topoff" :
102 info.state == CHARGING ? "charging" : "<unknown>"); 105 info.state == CHARGING ? "charging" : "<unknown>");
103 lcd_putsf(0, 8, "Battery: %d%%", battery_level()); 106 lcd_putsf(0, 8, "Battery: %d%%", battery_level());
107 lcd_putsf(0, 9, "Die temp: %d°C [%d, %d]",
108 adc_read(ADC_DIE_TEMP), IMX233_DIE_TEMP_HIGH,
109 IMX233_DIE_TEMP_LOW);
110 #ifdef ADC_BATT_TEMP
111 lcd_putsf(0, 10, "Batt temp: %d [%d, %d]",
112 adc_read(ADC_BATT_TEMP), IMX233_BATT_TEMP_HIGH,
113 IMX233_BATT_TEMP_LOW);
114 #endif
104 lcd_update(); 115 lcd_update();
105 } 116 }
106 } 117 }
@@ -137,19 +148,15 @@ void main(uint32_t arg, uint32_t addr)
137 148
138 button_init(); 149 button_init();
139 150
140 //button_debug_screen();
141 printf("Boot version: %s", RBVERSION); 151 printf("Boot version: %s", RBVERSION);
142 printf("arg=%x addr=%x", arg, addr); 152 printf("arg=%x addr=%x", arg, addr);
143 printf("power up source: %x", __XTRACT(HW_POWER_STS, PWRUP_SOURCE)); 153 printf("power up source: %x", __XTRACT(HW_POWER_STS, PWRUP_SOURCE));
144 154
145#ifdef SANSA_FUZEPLUS
146 extern void imx233_mmc_disable_window(void);
147 if(arg == 0xfee1dead) 155 if(arg == 0xfee1dead)
148 { 156 {
149 printf("Disable MMC window."); 157 printf("Disable partitions window.");
150 imx233_mmc_disable_window(); 158 imx233_partitions_enable_window(false);
151 } 159 }
152#endif
153 160
154 ret = storage_init(); 161 ret = storage_init();
155 if(ret < 0) 162 if(ret < 0)