freemyipod r946 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r945‎ | r946 | r947 >
Date:03:25, 16 June 2014
Author:theseven
Status:new
Tags:
Comment:
UMSboot: Merge upstream changes
Modified paths:
  • /umsboot/Makefile (modified) (history)
  • /umsboot/src/app/umsboot/DEPS (modified) (history)
  • /umsboot/src/app/umsboot/SOURCES (modified) (history)
  • /umsboot/src/app/umsboot/console.h (modified) (history)
  • /umsboot/src/soc/s5l87xx/init.c (modified) (history)
  • /umsboot/src/soc/s5l87xx/link.lds (modified) (history)
  • /umsboot/src/soc/s5l87xx/startup.S (modified) (history)
  • /umsboot/src/soc/s5l87xx/target.h (modified) (history)
  • /umsboot/src/sys/util.h (modified) (history)

Diff [purge]

Index: umsboot/src/app/umsboot/console.h
@@ -1,5 +1,5 @@
2 -#ifndef __TARGET_UMSBOOT_IPODNANO2G_H__
3 -#define __TARGET_UMSBOOT_IPODNANO2G_H__
 2+#ifndef __APP_UMSBOOT_CONSOLE_H__
 3+#define __APP_UMSBOOT_CONSOLE_H__
44
55 #include "global.h"
66 #include "interface/console/console.h"
Index: umsboot/src/app/umsboot/DEPS
@@ -1,3 +1,4 @@
22 ../../interface/lcd
33 ../../lib/simpletextrenderer
44 ../../lib/fbconsole
 5+
Index: umsboot/src/app/umsboot/SOURCES
@@ -3,3 +3,4 @@
44 main.c
55 usbglue.c
66 ums.c
 7+
Index: umsboot/src/soc/s5l87xx/startup.S
@@ -26,22 +26,21 @@
2727 .extern _fiq_handler
2828
2929
30 -.global _vectors
3130 .section .vectors,"ax",%progbits
32 -_vectors:
33 - b _reset_handler
34 - b _undef_instr_handler
35 - b _syscall_handler
36 - b _prefetch_abort_handler
37 - b _data_abort_handler
38 - b _reserved_handler
39 - b _irq_handler
40 - b _fiq_handler
 31+ ldr pc, =_reserved_handler
 32+ ldr pc, =_undef_instr_handler
 33+ ldr pc, =_syscall_handler
 34+ ldr pc, =_prefetch_abort_handler
 35+ ldr pc, =_data_abort_handler
 36+ ldr pc, =_reserved_handler
 37+ ldr pc, =_irq_handler
 38+ ldr pc, =_fiq_handler
4139
42 -_reset_handler:
 40+
 41+.section .init,"ax",%progbits
4342 @ Check if we need to relocate ourselves
44 - adr r0, _vectors
45 - ldr r1, =_vectors
 43+ adr r0, _init_end
 44+ ldr r1, =_text
4645 cmp r0, r1
4746 beq _relocated
4847 @ Move around as necessary
@@ -53,6 +52,19 @@
5453 subs r2, r2, #1
5554 bne _copy
5655 _relocated:
 56+ @ Check if the vectors need to be copied
 57+ ldr r2, =_vectors_src
 58+ sub r0, r0, r1
 59+ add r0, r0, r2
 60+ ldr r2, =(_vectors_size + 31)
 61+ ldr r1, =_vectors
 62+ mov r2, r2,lsr#5
 63+ @ Copy vectors
 64+_vectors_copy:
 65+ ldmia r0!, {r4-r11}
 66+ stmia r1!, {r4-r11}
 67+ subs r2, r2, #1
 68+ bne _vectors_copy
5769 #ifdef SOC_S5L8701
5870 @ Detect execution base address and remap memory at 0x0 accordingly (for IRQ vectors)
5971 tst r1, #0x20000000
@@ -136,7 +148,10 @@
137149
138150 @ Jump to final execution address (after relocation)
139151 ldr pc, =_enable_irqs
 152+.ltorg
 153+_init_end:
140154
 155+.section .text,"ax",%progbits
141156 _enable_irqs:
142157 @ Mask and clear all IRQs
143158 #ifdef SOC_S5L8701
@@ -228,3 +243,4 @@
229244 b hang
230245 .size reset, .-reset
231246 .size hang, .-hang
 247+
Index: umsboot/src/soc/s5l87xx/target.h
@@ -4,3 +4,4 @@
55
66
77 #endif
 8+
Index: umsboot/src/soc/s5l87xx/link.lds
@@ -13,18 +13,36 @@
1414 #define SDRAM_SIZE DEFAULT_SDRAM_SIZE
1515 #endif
1616
 17+#ifndef VECTORS_REGION
 18+#define VECTORS_REGION SRAM
 19+#endif
 20+#ifndef VECTORS_BASE
 21+#define VECTORS_BASE SRAM_BASE
 22+#endif
1723 #ifndef CODE_REGION
1824 #define CODE_REGION SDRAM
1925 #endif
 26+#ifndef CODE_BASE
 27+#define CODE_BASE
 28+#endif
2029 #ifndef BSS_REGION
2130 #define BSS_REGION SDRAM
2231 #endif
 32+#ifndef BSS_BASE
 33+#define BSS_BASE
 34+#endif
2335 #ifndef DMABSS_REGION
2436 #define DMABSS_REGION SRAM
2537 #endif
 38+#ifndef DMABSS_BASE
 39+#define DMABSS_BASE
 40+#endif
2641 #ifndef STACK_REGION
2742 #define STACK_REGION SRAM
2843 #endif
 44+#ifndef STACK_BASE
 45+#define STACK_BASE
 46+#endif
2947
3048 #ifndef STACK_SIZE
3149 #define STACK_SIZE 0x1000
@@ -44,16 +62,18 @@
4563 SDRAM : ORIGIN = SDRAM_BASE, LENGTH = SDRAM_SIZE
4664 }
4765
48 -_entry = _vectors;
 66+_entry = _init;
4967 ENTRY(_entry)
5068
5169 SECTIONS
5270 {
5371
54 - .text :
 72+ .text CODE_BASE :
5573 {
 74+ _init = .;
 75+ KEEP(*(.init))
 76+ _init_end = .;
5677 _text = .;
57 - KEEP(*(.vectors))
5878 *(.text)
5979 *(.text.*)
6080 *(.rodata)
@@ -70,9 +90,25 @@
7191
7292 _text_size = _text_end - _text;
7393
74 - .bss (NOLOAD) :
 94+ .vectors VECTORS_BASE :
7595 {
 96+ _vectors = .;
 97+ KEEP(*(.vectors))
 98+ _vectors_end = .;
 99+ } >VECTORS_REGION AT>CODE_REGION
 100+
 101+ _vectors_src = LOADADDR(.vectors);
 102+ _vectors_size = _vectors_end - _vectors;
 103+
 104+ .dummy _text_end - 4 :
 105+ {
 106+ . += 4;
76107 . = ALIGN(1 << CACHEALIGN_BITS);
 108+ } >CODE_REGION
 109+
 110+ .bss BSS_BASE (NOLOAD) :
 111+ {
 112+ . = ALIGN(1 << CACHEALIGN_BITS);
77113 _bss = .;
78114 *(.bss)
79115 *(.bss.*)
@@ -83,7 +119,7 @@
84120
85121 _bss_size = _bss_end - _bss;
86122
87 - .dmabss (NOLOAD) :
 123+ .dmabss DMABSS_BASE (NOLOAD) :
88124 {
89125 . = ALIGN(1 << CACHEALIGN_BITS);
90126 _dmabss = .;
@@ -95,7 +131,7 @@
96132
97133 _dmabss_size = _dmabss_end - _dmabss;
98134
99 - .stack (NOLOAD) :
 135+ .stack STACK_BASE (NOLOAD) :
100136 {
101137 . = ALIGN(1 << CACHEALIGN_BITS);
102138 _stack = .;
Index: umsboot/src/soc/s5l87xx/init.c
@@ -7,3 +7,4 @@
88 {
99 main();
1010 }
 11+
Index: umsboot/src/sys/util.h
@@ -111,7 +111,7 @@
112112 #ifndef ASM_FILE
113113 extern __attribute__((noreturn)) void powerdown();
114114 extern __attribute__((noreturn)) void hang();
115 -extern __attribute__((pure)) void idle();
 115+extern void idle();
116116 extern __attribute__((noreturn)) void execfirmware(void* address);
117117 extern void enter_critical_section();
118118 extern void leave_critical_section();
Index: umsboot/Makefile
@@ -99,7 +99,7 @@
100100 SRC := $(foreach file,$(SRC),$(call relpath,$(file)))
101101 OBJ := $(SRC:src/%.c=build/$(TARGET)/$(TYPE)/%.o)
102102 OBJ := $(OBJ:src/%.S=build/$(TARGET)/$(TYPE)/%.o)
103 -_LDSCRIPT = $(LDSCRIPT:src/%.lds=build/$(TARGET)/$(TYPE)/%.lds)
 103+_LDSCRIPT := $(LDSCRIPT:src/%.lds=build/$(TARGET)/$(TYPE)/%.lds)
104104
105105 _ASMFLAGS := $(CFLAGS_GENERAL) $(CFLAGS_ASM) $(CFLAGS_$(TYPE)) $(_CFLAGS) $(_PPFLAGS) $(CFLAGS) $(ASMFLAGS)
106106 _CFLAGS := $(CFLAGS_GENERAL) $(CFLAGS_$(TYPE)) $(_CFLAGS) $(_PPFLAGS) $(CFLAGS)