summaryrefslogtreecommitdiff
path: root/bootloader/imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/imx233.c')
-rw-r--r--bootloader/imx233.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index abb9df833b..ebd67cea6c 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -50,6 +50,8 @@
50extern char loadaddress[]; 50extern char loadaddress[];
51extern char loadaddressend[]; 51extern char loadaddressend[];
52 52
53#define MSG(width, short, long) (LCD_WIDTH < (width) ? short : long)
54
53#ifdef HAVE_BOOTLOADER_USB_MODE 55#ifdef HAVE_BOOTLOADER_USB_MODE
54static void usb_mode(int connect_timeout) 56static void usb_mode(int connect_timeout)
55{ 57{
@@ -98,7 +100,7 @@ static void usb_mode(int connect_timeout)
98 if(button == SYS_USB_DISCONNECTED) 100 if(button == SYS_USB_DISCONNECTED)
99 break; 101 break;
100 struct imx233_powermgmt_info_t info = imx233_powermgmt_get_info(); 102 struct imx233_powermgmt_info_t info = imx233_powermgmt_get_info();
101 lcd_putsf(0, 7, "Charging status: %s", 103 lcd_putsf(0, 7, "%s: %s", MSG(240, "Status", "Charging status"),
102 info.state == CHARGE_STATE_DISABLED ? "disabled" : 104 info.state == CHARGE_STATE_DISABLED ? "disabled" :
103 info.state == CHARGE_STATE_ERROR ? "error" : 105 info.state == CHARGE_STATE_ERROR ? "error" :
104 info.state == DISCHARGING ? "discharging" : 106 info.state == DISCHARGING ? "discharging" :
@@ -106,11 +108,11 @@ static void usb_mode(int connect_timeout)
106 info.state == TOPOFF ? "topoff" : 108 info.state == TOPOFF ? "topoff" :
107 info.state == CHARGING ? "charging" : "<unknown>"); 109 info.state == CHARGING ? "charging" : "<unknown>");
108 lcd_putsf(0, 8, "Battery: %d%% (%d mV)", battery_level(), battery_voltage()); 110 lcd_putsf(0, 8, "Battery: %d%% (%d mV)", battery_level(), battery_voltage());
109 lcd_putsf(0, 9, "Die temp: %d°C [%d, %d]", 111 lcd_putsf(0, 9, "%s: %d 'C [%d, %d]", MSG(240, "Die", "Die temp"),
110 adc_read(ADC_DIE_TEMP), IMX233_DIE_TEMP_HIGH, 112 adc_read(ADC_DIE_TEMP), IMX233_DIE_TEMP_HIGH,
111 IMX233_DIE_TEMP_LOW); 113 IMX233_DIE_TEMP_LOW);
112 #ifdef ADC_BATT_TEMP 114 #ifdef ADC_BATT_TEMP
113 lcd_putsf(0, 10, "Batt temp: %d [%d, %d]", 115 lcd_putsf(0, 10, "%s: %d 'C [%d, %d]", MSG(240, "Batt", "Batt temp"),
114 adc_read(ADC_BATT_TEMP), IMX233_BATT_TEMP_HIGH, 116 adc_read(ADC_BATT_TEMP), IMX233_BATT_TEMP_HIGH,
115 IMX233_BATT_TEMP_LOW); 117 IMX233_BATT_TEMP_LOW);
116 #endif 118 #endif
@@ -150,15 +152,16 @@ void main(uint32_t arg, uint32_t addr)
150 152
151 button_init(); 153 button_init();
152 154
153 printf("Boot version: %s", RBVERSION); 155 printf("%s: %s", MSG(240, "Ver", "Boot version"), RBVERSION);
154 printf("arg=%x addr=%x", arg, addr); 156 printf("%s: %x ", MSG(240, "Arg", "Boot arg"), arg);
157 printf("%s: %x", MSG(240, "Addr", "Boot addr"), addr);
155#if IMX233_SUBTARGET >= 3780 158#if IMX233_SUBTARGET >= 3780
156 printf("power up source: %x", BF_RD(POWER_STS, PWRUP_SOURCE)); 159 printf("Power up source: %x", BF_RD(POWER_STS, PWRUP_SOURCE));
157#endif 160#endif
158 161
159 if(arg == 0xfee1dead) 162 if(arg == 0xfee1dead)
160 { 163 {
161 printf("Disable partitions window."); 164 printf("%s", MSG(240, "Disable window", "Disable partitions window"));
162 imx233_partitions_enable_window(false); 165 imx233_partitions_enable_window(false);
163 } 166 }
164 167