Changeset 4d0f97d in mainline
- Timestamp:
- 2010-07-16T14:23:41Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e2650d3
- Parents:
- aa0d227 (diff), 24697c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 9 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
raa0d227 r4d0f97d 58 58 59 59 % Machine type 60 @ "gta02" GTA02 / Neo FreeRunner 60 61 @ "testarm" GXEmul Testarm 61 62 @ "integratorcp" Integratorcp … … 389 390 % Output device class 390 391 @ "generic" Monitor or serial line 391 ! [PLATFORM=arm32& MACHINE=integratorcp] CONFIG_HID_OUT (choice)392 ! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp)] CONFIG_HID_OUT (choice) 392 393 393 394 % Output device class … … 436 437 % Support for NS16550 controller 437 438 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=serial)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_NS16550 (y/n) 439 440 % Support for Samsung S3C24XX on-chip UART 441 ! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_UART (y/n) 438 442 439 443 % Support for Z8530 controller -
boot/Makefile
raa0d227 r4d0f97d 72 72 73 73 clean_dist: 74 rm -f $(INITRD).fs $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) *.co74 rm -f $(INITRD).fs $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) $(LINK).comp *.co 75 75 rm -f $(USPACE_PATH)/dist/srv/* 76 76 rm -f $(USPACE_PATH)/dist/app/* -
boot/Makefile.build
raa0d227 r4d0f97d 106 106 $(LD) -N $(LFLAGS) -T $(LINK) -M -Map $(MAP) -o $@ $(COMPONENT_OBJECTS) $(OBJECTS) 107 107 108 $(LINK): $(LINK).comp $(DEPEND) 109 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).comp | grep -v "^\#" > $(LINK) 110 108 111 %.o: %.S $(DEPEND) 109 112 $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ -
boot/Makefile.common
raa0d227 r4d0f97d 55 55 MKTMPFS = $(TOOLS_PATH)/mktmpfs.py 56 56 MKFAT = $(TOOLS_PATH)/mkfat.py 57 MKUIMAGE = $(TOOLS_PATH)/mkuimage.py 57 58 58 59 JOBFILE = $(ROOT_PATH)/tools/jobfile.py -
boot/arch/arm32/Makefile.inc
raa0d227 r4d0f97d 27 27 # 28 28 29 ifeq ($(MACHINE), gta02) 30 BOOT_OUTPUT = image.boot 31 POST_OUTPUT = $(ROOT_PATH)/uImage.bin 32 POSTBUILD = Makefile.uboot 33 endif 34 29 35 BFD_NAME = elf32-littlearm 30 36 BFD_OUTPUT = $(BFD_NAME) -
boot/arch/arm32/_link.ld.in
raa0d227 r4d0f97d 1 #include <arch/arch.h> 2 1 3 ENTRY(start) 2 4 3 5 SECTIONS { 4 . = 0x0000;6 . = BOOT_BASE; 5 7 .text : { 6 8 *(BOOTSTRAP); 7 9 *(.text); 8 10 } 9 . = 0x8000;11 . = BOOT_BASE + 0x8000; 10 12 .data : { 11 13 *(BOOTPT); /* bootstrap page table */ -
boot/arch/arm32/include/arch.h
raa0d227 r4d0f97d 36 36 #define PTL0_ENTRY_SIZE 4 37 37 38 #define BOOT_OFFSET 0xa00000 38 /* 39 * Address where the boot stage image starts (beginning of usable physical 40 * memory). 41 */ 42 #ifdef MACHINE_gta02 43 #define BOOT_BASE 0x30008000 44 #else 45 #define BOOT_BASE 0x00000000 46 #endif 47 48 #define BOOT_OFFSET (BOOT_BASE + 0xa00000) 39 49 40 50 #ifndef __ASM__ -
boot/arch/arm32/include/main.h
raa0d227 r4d0f97d 1 1 /* 2 2 * Copyright (c) 2007 Michal Kebrt 3 * Copyright (c) 2010 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 38 39 39 40 /** Address where characters to be printed are expected. */ 40 #ifdef MACHINE_testarm41 #define VIDEORAM_ADDRESS 0x1000000042 #endif43 41 44 #ifdef MACHINE_integratorcp 45 #define VIDEORAM_ADDRESS 0x16000000 46 #endif 42 /** GTA02 serial console UART register addresses. 43 * 44 * This is UART channel 2 of the S3C24xx CPU 45 */ 46 #define GTA02_SCONS_UTRSTAT 0x50008010 47 #define GTA02_SCONS_UTXH 0x50008020 48 49 /* Bits in UTXH register */ 50 #define S3C24XX_UTXH_TX_EMPTY 0x00000004 51 52 53 /** GXemul testarm serial console output register */ 54 #define TESTARM_SCONS_ADDR 0x10000000 55 56 /** IntegratorCP serial console output register */ 57 #define ICP_SCONS_ADDR 0x16000000 47 58 48 59 extern void bootstrap(void); -
boot/arch/arm32/src/putchar.c
raa0d227 r4d0f97d 2 2 * Copyright (c) 2007 Michal Kebrt 3 3 * Copyright (c) 2009 Vineeth Pillai 4 * Copyright (c) 2010 Jiri Svoboda 4 5 * All rights reserved. 5 6 * … … 40 41 #include <str.h> 41 42 43 #ifdef MACHINE_gta02 44 45 /** Send a byte to the gta02 serial console. 46 * 47 * @param byte Byte to send. 48 */ 49 static void scons_sendb_gta02(uint8_t byte) 50 { 51 volatile uint32_t *utrstat; 52 volatile uint32_t *utxh; 53 54 utrstat = (volatile uint32_t *) GTA02_SCONS_UTRSTAT; 55 utxh = (volatile uint32_t *) GTA02_SCONS_UTXH; 56 57 /* Wait until transmitter is empty. */ 58 while ((*utrstat & S3C24XX_UTXH_TX_EMPTY) == 0) 59 ; 60 61 /* Transmit byte. */ 62 *utxh = (uint32_t) byte; 63 } 64 65 #endif 66 67 #ifdef MACHINE_testarm 68 69 /** Send a byte to the GXemul testarm serial console. 70 * 71 * @param byte Byte to send. 72 */ 73 static void scons_sendb_testarm(uint8_t byte) 74 { 75 *((volatile uint8_t *) TESTARM_SCONS_ADDR) = byte; 76 } 77 78 #endif 79 80 #ifdef MACHINE_integratorcp 81 82 /** Send a byte to the IntegratorCP serial console. 83 * 84 * @param byte Byte to send. 85 */ 86 static void scons_sendb_icp(uint8_t byte) 87 { 88 *((volatile uint8_t *) ICP_SCONS_ADDR) = byte; 89 } 90 91 #endif 92 93 /** Send a byte to the serial console. 94 * 95 * @param byte Byte to send. 96 */ 97 static void scons_sendb(uint8_t byte) 98 { 99 #ifdef MACHINE_gta02 100 scons_sendb_gta02(byte); 101 #endif 102 #ifdef MACHINE_testarm 103 scons_sendb_testarm(byte); 104 #endif 105 #ifdef MACHINE_integratorcp 106 scons_sendb_icp(byte); 107 #endif 108 } 109 110 /** Display a character 111 * 112 * @param ch Character to display 113 */ 42 114 void putchar(const wchar_t ch) 43 115 { 44 116 if (ch == '\n') 45 *((volatile char *) VIDEORAM_ADDRESS) = '\r';46 117 scons_sendb('\r'); 118 47 119 if (ascii_check(ch)) 48 *((volatile char *) VIDEORAM_ADDRESS) = ch;120 scons_sendb((uint8_t) ch); 49 121 else 50 *((volatile char *) VIDEORAM_ADDRESS) = U_SPECIAL;122 scons_sendb(U_SPECIAL); 51 123 } 52 124 -
kernel/arch/arm32/Makefile.inc
raa0d227 r4d0f97d 60 60 arch/$(KARCH)/src/ras.c 61 61 62 ifeq ($(MACHINE),gta02) 63 ARCH_SOURCES += arch/$(KARCH)/src/mach/gta02/gta02.c 64 endif 65 62 66 ifeq ($(MACHINE),testarm) 63 67 ARCH_SOURCES += arch/$(KARCH)/src/mach/testarm/testarm.c -
kernel/arch/arm32/_link.ld.in
raa0d227 r4d0f97d 7 7 */ 8 8 9 #ifdef MACHINE_gta02 10 #define KERNEL_LOAD_ADDRESS 0xb0a08000 11 #else 9 12 #define KERNEL_LOAD_ADDRESS 0x80a00000 13 #endif 10 14 11 15 OUTPUT_ARCH(arm) -
kernel/arch/arm32/include/mach/integratorcp/integratorcp.h
raa0d227 r4d0f97d 103 103 extern void icp_cpu_halt(void); 104 104 extern void icp_irq_exception(unsigned int, istate_t *); 105 extern uintptr_t icp_get_memory_size(void);105 extern void icp_get_memory_extents(uintptr_t *, uintptr_t *); 106 106 extern void icp_frame_init(void); 107 107 108 108 extern struct arm_machine_ops icp_machine_ops; 109 110 /** Size of IntegratorCP IRQ number range (starting from 0) */ 111 #define ICP_IRQ_COUNT 8 109 112 110 113 #endif -
kernel/arch/arm32/include/mach/testarm/testarm.h
raa0d227 r4d0f97d 42 42 #include <arch/machine_func.h> 43 43 44 /** Last interrupt number (beginning from 0) whose status is probed 45 * from interrupt controller 46 */ 47 #define GXEMUL_IRQC_MAX_IRQ 8 48 #define GXEMUL_KBD_IRQ 2 49 #define GXEMUL_TIMER_IRQ 4 44 /** Size of GXemul IRQ number range (starting from 0) */ 45 #define GXEMUL_IRQ_COUNT 32 46 #define GXEMUL_KBD_IRQ 2 47 #define GXEMUL_TIMER_IRQ 4 50 48 51 49 /** Timer frequency */ … … 73 71 extern void gxemul_cpu_halt(void); 74 72 extern void gxemul_irq_exception(unsigned int, istate_t *); 75 extern uintptr_t gxemul_get_memory_size(void);73 extern void gxemul_get_memory_extents(uintptr_t *, uintptr_t *); 76 74 extern void gxemul_frame_init(void); 77 75 -
kernel/arch/arm32/include/machine_func.h
raa0d227 r4d0f97d 47 47 48 48 struct arm_machine_ops { 49 void 50 void 51 void 52 uintptr_t (*machine_get_memory_size)(void);53 void (*machine_irq_exception)(unsigned int, istate_t*);54 void 55 void 56 void 49 void (*machine_init)(void); 50 void (*machine_timer_irq_start)(void); 51 void (*machine_cpu_halt)(void); 52 void (*machine_get_memory_extents)(uintptr_t *, uintptr_t *); 53 void (*machine_irq_exception)(unsigned int, istate_t *); 54 void (*machine_frame_init)(void); 55 void (*machine_output_init)(void); 56 void (*machine_input_init)(void); 57 57 }; 58 58 … … 74 74 extern void machine_cpu_halt(void); 75 75 76 77 /** Returns size of available memory. 76 /** Get extents of available memory. 78 77 * 79 * @return Size of available memory. 78 * @param start Place to store memory start address. 79 * @param size Place to store memory size. 80 80 */ 81 extern uintptr_t machine_get_memory_size(void); 82 81 extern void machine_get_memory_extents(uintptr_t *start, uintptr_t *size); 83 82 84 83 /** Interrupt exception handler. … … 105 104 extern void machine_input_init(void); 106 105 106 extern size_t machine_get_irq_count(void); 107 107 108 #endif 108 109 -
kernel/arch/arm32/include/mm/frame.h
raa0d227 r4d0f97d 46 46 47 47 #define BOOT_PAGE_TABLE_SIZE 0x4000 48 #define BOOT_PAGE_TABLE_ADDRESS 0x8000 48 49 #ifdef MACHINE_gta02 50 #define BOOT_PAGE_TABLE_ADDRESS 0x30010000 51 #else 52 #define BOOT_PAGE_TABLE_ADDRESS 0x00008000 53 #endif 49 54 50 55 #define BOOT_PAGE_TABLE_START_FRAME (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH) 51 56 #define BOOT_PAGE_TABLE_SIZE_IN_FRAMES (BOOT_PAGE_TABLE_SIZE >> FRAME_WIDTH) 57 58 #ifdef MACHINE_gta02 59 #define PHYSMEM_START_ADDR 0x30008000 60 #else 61 #define PHYSMEM_START_ADDR 0x00000000 62 #endif 52 63 53 64 extern uintptr_t last_frame; -
kernel/arch/arm32/src/exc_handler.S
raa0d227 r4d0f97d 96 96 ldmfd r3!, {r4-r7} 97 97 stmfd r13!, {r4-r7} 98 stmfd r13!, {r13, lr}^ 98 mov r4, r13 99 stmfd r4, {r13, lr}^ 100 nop /* Cannot access r13 immediately after stm(2) */ 101 sub r13, r13, #8 99 102 stmfd r13!, {r2} 100 103 … … 137 140 138 141 # return to user mode 139 ldmfd r13!, {r13, lr}^ 142 mov r0, r13 143 ldmfd r0, {r13, lr}^ 144 nop /* Cannot access r13 immediately after ldm(2) */ 145 add r13, r13, #8 140 146 b 2f 141 147 -
kernel/arch/arm32/src/interrupt.c
raa0d227 r4d0f97d 40 40 #include <ddi/device.h> 41 41 #include <interrupt.h> 42 43 /** Initial size of a table holding interrupt handlers. */44 #define IRQ_COUNT 845 42 46 43 /** Disable interrupts. … … 105 102 void interrupt_init(void) 106 103 { 107 irq_init(IRQ_COUNT, IRQ_COUNT); 104 size_t irq_count; 105 106 irq_count = machine_get_irq_count(); 107 irq_init(irq_count, irq_count); 108 108 109 machine_timer_irq_start(); 109 110 } -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
raa0d227 r4d0f97d 60 60 icp_timer_irq_start, 61 61 icp_cpu_halt, 62 icp_get_memory_ size,62 icp_get_memory_extents, 63 63 icp_irq_exception, 64 64 icp_frame_init, … … 214 214 } 215 215 216 /** Returns the size of emulated memory. 217 * 218 * @return Size in bytes. 219 */ 220 size_t icp_get_memory_size(void) 221 { 216 /** Get extents of available memory. 217 * 218 * @param start Place to store memory start address. 219 * @param size Place to store memory size. 220 */ 221 void icp_get_memory_extents(uintptr_t *start, uintptr_t *size) 222 { 223 *start = 0; 224 222 225 if (hw_map_init_called) { 223 return (sdram[((*(uint32_t *)icp_hw_map.sdramcr & ICP_SDRAM_MASK) >> 2)]); 226 *size = (sdram[((*(uint32_t *)icp_hw_map.sdramcr & 227 ICP_SDRAM_MASK) >> 2)]); 224 228 } else { 225 return SDRAM_SIZE; 226 } 227 229 *size = SDRAM_SIZE; 230 } 228 231 } 229 232 -
kernel/arch/arm32/src/mach/testarm/testarm.c
raa0d227 r4d0f97d 60 60 gxemul_timer_irq_start, 61 61 gxemul_cpu_halt, 62 gxemul_get_memory_ size,62 gxemul_get_memory_extents, 63 63 gxemul_irq_exception, 64 64 gxemul_frame_init, … … 185 185 } 186 186 187 /** Returns the size of emulated memory. 188 * 189 * @return Size in bytes. 190 */ 191 uintptr_t gxemul_get_memory_size(void) 192 { 193 return *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET)); 194 } 195 187 /** Get extents of available memory. 188 * 189 * @param start Place to store memory start address. 190 * @param size Place to store memory size. 191 */ 192 void gxemul_get_memory_extents(uintptr_t *start, uintptr_t *size) 193 { 194 *start = 0; 195 *size = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET)); 196 } 196 197 197 198 /** Returns the mask of active interrupts. */ … … 210 211 unsigned int i; 211 212 212 for (i = 0; i < GXEMUL_IRQ C_MAX_IRQ; i++) {213 for (i = 0; i < GXEMUL_IRQ_COUNT; i++) { 213 214 if (sources & (1 << i)) { 214 215 irq_t *irq = irq_dispatch_and_lock(i); -
kernel/arch/arm32/src/machine_func.c
raa0d227 r4d0f97d 39 39 40 40 #include <arch/machine_func.h> 41 #include <arch/mach/gta02/gta02.h> 41 42 #include <arch/mach/integratorcp/integratorcp.h> 42 43 #include <arch/mach/testarm/testarm.h> … … 48 49 void machine_ops_init(void) 49 50 { 50 #if defined(MACHINE_testarm) 51 #if defined(MACHINE_gta02) 52 machine_ops = >a02_machine_ops; 53 #elif defined(MACHINE_testarm) 51 54 machine_ops = &gxemul_machine_ops; 52 55 #elif defined(MACHINE_integratorcp) … … 77 80 } 78 81 79 80 /** Returns size of available memory. 82 /** Get extents of available memory. 81 83 * 82 * @return Size of available memory. 84 * @param start Place to store memory start address. 85 * @param size Place to store memory size. 83 86 */ 84 uintptr_t machine_get_memory_size(void)87 void machine_get_memory_extents(uintptr_t *start, uintptr_t *size) 85 88 { 86 return (machine_ops->machine_get_memory_size)();89 (machine_ops->machine_get_memory_extents)(start, size); 87 90 } 88 91 … … 122 125 } 123 126 127 /** Get IRQ number range used by machine. */ 128 size_t machine_get_irq_count(void) 129 { 130 size_t irq_count; 131 132 #if defined(MACHINE_gta02) 133 irq_count = GTA02_IRQ_COUNT; 134 #elif defined(MACHINE_testarm) 135 irq_count = GXEMUL_IRQ_COUNT; 136 #elif defined(MACHINE_integratorcp) 137 irq_count = ICP_IRQ_COUNT; 138 #else 139 #error Machine type not defined. 140 #endif 141 return irq_count; 142 } 143 124 144 /** @} 125 145 */ -
kernel/arch/arm32/src/mm/frame.c
raa0d227 r4d0f97d 38 38 #include <arch/machine_func.h> 39 39 #include <config.h> 40 #include <align.h> 40 41 41 42 /** Address of the last frame in the memory. */ … … 45 46 void frame_arch_init(void) 46 47 { 47 last_frame = machine_get_memory_size(); 48 uintptr_t mem_start, mem_size; 49 uintptr_t first_frame; 50 uintptr_t num_frames; 51 52 machine_get_memory_extents(&mem_start, &mem_size); 53 first_frame = ALIGN_UP(mem_start, FRAME_SIZE); 54 last_frame = ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE); 55 num_frames = (last_frame - first_frame) >> FRAME_WIDTH; 48 56 49 57 /* All memory as one zone */ 50 zone_create( 0, ADDR2PFN(last_frame),58 zone_create(first_frame >> FRAME_WIDTH, num_frames, 51 59 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 52 60 -
kernel/arch/arm32/src/mm/page.c
raa0d227 r4d0f97d 58 58 uintptr_t cur; 59 59 /* Kernel identity mapping */ 60 for (cur = 0; cur < last_frame; cur += FRAME_SIZE)60 for (cur = PHYSMEM_START_ADDR; cur < last_frame; cur += FRAME_SIZE) 61 61 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 62 62 … … 68 68 #error "Only high exception vector supported now" 69 69 #endif 70 cur = ALIGN_DOWN(0x50008010, FRAME_SIZE); 71 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 70 72 71 73 page_table_unlock(AS_KERNEL, true); -
kernel/arch/arm32/src/userspace.c
raa0d227 r4d0f97d 97 97 "mov sp, %[ustate]\n" 98 98 "msr spsr_c, %[user_mode]\n" 99 "ldmfd sp!, {r0-r12, sp, lr}^\n" 99 "ldmfd sp, {r0-r12, sp, lr}^\n" 100 "nop\n" /* Cannot access sp immediately after ldm(2) */ 101 "add sp, sp, #(15*4)\n" 100 102 "ldmfd sp!, {pc}^\n" 101 103 :: [ustate] "r" (&ustate), [user_mode] "r" (user_mode) -
kernel/genarch/Makefile.inc
raa0d227 r4d0f97d 90 90 endif 91 91 92 ifeq ($(CONFIG_S3C24XX_UART),y) 93 GENARCH_SOURCES += \ 94 genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c 95 endif 96 92 97 ifeq ($(CONFIG_Z8530),y) 93 98 GENARCH_SOURCES += \ -
tools/pack.py
raa0d227 r4d0f97d 191 191 link_in.close() 192 192 193 link_out = file(os.path.join(arch_path, LINK), "w")193 link_out = file(os.path.join(arch_path, "%s.comp" % LINK), "w") 194 194 link_out.write(template.replace("[[COMPONENTS]]", "\n".join(link_ctx))) 195 195 link_out.close() -
uspace/srv/hid/kbd/Makefile
raa0d227 r4d0f97d 58 58 59 59 ifeq ($(UARCH),arm32) 60 ifeq ($(MACHINE),gta02) 61 SOURCES += \ 62 port/dummy.c \ 63 ctl/pc.c 64 endif 60 65 ifeq ($(MACHINE),testarm) 61 66 SOURCES += \
Note:
See TracChangeset
for help on using the changeset viewer.