URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/uclinux/uClinux-2.0.x/arch/or32/board
- from Rev 1313 to Rev 1765
- ↔ Reverse comparison
Rev 1313 → Rev 1765
/rom.ld
0,0 → 1,82
MEMORY |
{ |
romvec : ORIGIN = 0xf0000000, LENGTH = 0x2000 |
flash : ORIGIN = 0xf0002000, LENGTH = 0x00800000 - 0x2000 |
eflash : ORIGIN = 0xf0800000, LENGTH = 0 |
ramvec : ORIGIN = 0x00000000, LENGTH = 0x00002000 |
ram : ORIGIN = 0x00002000, LENGTH = 0x00800000 - 0x2000 |
eram : ORIGIN = 0x00800000, LENGTH = 0 |
} |
|
SECTIONS |
{ |
.romvec : |
{ |
__romvec = . ; |
*(.romvec) |
} > romvec |
|
.text : |
{ |
___rom_start = . ; |
text_start = . ; |
*(.text) |
} > flash |
|
.rodata : |
{ |
*(.rodata) |
__etext = . ; |
} > flash |
|
.initrd : |
{ |
__initrd_start = . ; |
*(.initrd) |
__initrd_end = . ; |
___data_rom_start = . ; |
} > flash |
|
.eflash : |
{ |
__flashend = . ; |
} > eflash |
|
.data : |
AT ( ADDR (.initrd) + SIZEOF (.initrd)) |
{ |
__ramstart = . ; |
__sdata = . ; |
___data_start = . ; |
*(.data) |
__edata = . ; |
__end_data = . ; |
__data_end = . ; |
edata = ALIGN( 0x10 ) ; |
} > ram |
|
.bss : |
{ |
__sbss = ALIGN( 0x10 ) ; |
___bss_start = ALIGN( 0x10 ) ; |
*(.bss) |
*(COMMON) |
__ebss = . ; |
___bss_end = . ; |
end = ALIGN( 0x10 ) ; |
__end = ALIGN( 0x10 ) ; |
} > ram |
|
.ramvec : |
AT ( ADDR (.initrd) + SIZEOF (.initrd) + SIZEOF (.data)) |
{ |
__ramvec_start = . ; |
*(.ramvec) |
__ramvec_end = . ; |
} > ramvec |
|
.eram : |
{ |
__ramend = . ; |
} > eram |
} |
/ram.ld
0,0 → 1,76
MEMORY |
{ |
romvec : ORIGIN = 0xf0010000, LENGTH = 0x00002000 |
flash : ORIGIN = 0xf0012000, LENGTH = 0x00200000 - 0x00012000 |
eflash : ORIGIN = 0xf0200000, LENGTH = 0 |
ramvec : ORIGIN = 0x00000000, LENGTH = 0x00002000 |
ram : ORIGIN = 0x00020400, LENGTH = 0x00400000 - 0x00020400 |
eram : ORIGIN = 0x00800000, LENGTH = 0 |
initrd : ORIGIN = 0x00700000, LENGTH = 0x00400000 |
} |
|
SECTIONS |
{ |
.ramvec : |
{ |
__ramvec = . ; |
__ramvec_start = . ; |
*(.ramvec) |
__ramvec_end = . ; |
} > ramvec |
|
.romvec : |
{ |
__romvec = . ; |
} > romvec |
|
.text : |
{ |
__ramstart = . ; |
text_start = . ; |
*(.text) |
___data_rom_start = ALIGN ( 4 ) ; |
} > ram |
|
.rodata : |
{ |
*(.rodata) |
*(.rodata.str1.1) |
__etext = . ; |
} > ram |
|
.data : |
{ |
__sdata = . ; |
___data_start = . ; |
*(.data) |
__edata = . ; |
__end_data = . ; |
edata = ALIGN( 0x10 ) ; |
} > ram |
|
.bss : |
{ |
__sbss = ALIGN( 0x10 ) ; |
___bss_start = ALIGN( 0x10 ) ; |
__data_end = ALIGN( 0x10 ) ; |
*(.bss) |
*(COMMON) |
__ebss = . ; |
___bss_end = . ; |
end = ALIGN( 0x10 ) ; |
__end = ALIGN( 0x10 ) ; |
} > ram |
|
.eram : |
{ |
__ramend = . ; |
} > eram |
|
.initrd : |
{ |
__initrd_start = . ; |
*(.initrd) |
__initrd_end = . ; |
} > initrd |
} |
/initrd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
initrd
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: uncomp.c
===================================================================
--- uncomp.c (nonexistent)
+++ uncomp.c (revision 1765)
@@ -0,0 +1,56 @@
+#include
+
+#define CRCI(x) (crci = (crci << 5) | (x))
+#define CRCO(x) (crco = (crco << 5) | (x))
+
+unsigned long decompress (unsigned char *in, unsigned char *out)
+{
+ unsigned char hist[0x10000];
+ unsigned long size;
+ int b = 0, i;
+ unsigned char *orig = in;
+ unsigned char *mask;
+ unsigned short hash = 0;
+ unsigned long crci = 0, crco = 0;
+
+ for (i = 0; i < 0x10000; i++) hist[i] = 0;
+
+ CRCI(*in); size = (*in++) << 24;
+ CRCI(*in); size |= (*in++) << 16;
+ CRCI(*in); size |= (*in++) << 8;
+ CRCI(*in); size |= (*in++) << 0;
+ CRCI(*in); mask = in++;
+_print("Size = %x\n", size);
+ for (i = 0; i < size; i++) {
+ unsigned char c;
+ if ((*mask >> b) & 1) c = hist[hash];
+ else CRCI(c = *in++);
+ CRCO(*out++ = c);
+ hist[hash] = c;
+ hash <<= 8;
+ hash |= c;
+ hash &= 0xffff;
+ if (++b == 8) {
+ CRCI(*in);
+ mask = in++;
+ b = 0;
+ }
+ }
+/*
+ print_str ("compressed CRC = ");
+ print_n (crci);
+ print_str ("\ndecompressed CRC = ");
+ print_n (crco);
+ print_str ("\ndecompressed size = ");
+ print_n (size);
+ print_str (" end ");
+ print_n (out);
+ print_str ("\ncompressed size = ");
+ print_n (in - orig);
+ print_str (" end ");
+ print_n (in);
+ print_str ("\n");
+*/
+ return size;
+}
+
Index: reset.S
===================================================================
--- reset.S (nonexistent)
+++ reset.S (revision 1765)
@@ -0,0 +1,161 @@
+#include
+#include
+#include
+
+#undef IC_ENABLE
+#define IC_ENABLE 1
+
+ .extern _reset_support
+ .extern _src_beg
+ .extern _dst_beg
+ .extern _dst_end
+ .extern _c_reset
+
+ .global start
+ .global _lolev_ie
+ .global _str
+
+ .section .stack
+ .space 0x30000
+_stack:
+
+ .section .reset, "a"
+
+ .org 0x100
+start:
+_reset:
+ l.addi r3,r0,SPR_SR_SM
+ l.mtspr r0,r3,SPR_SR
+ l.movhi r3,hi(_start)
+ l.ori r3,r3,lo(_start)
+ l.jr r3
+ l.nop
+
+ .section .text
+
+_start:
+ l.jal init_mc
+ l.nop
+
+.if IC_ENABLE
+ l.jal _ic_enable
+ l.nop
+.endif
+
+ /* Copy form flash to sram */
+.if 1
+ l.movhi r3,hi(_src_beg)
+ l.ori r3,r3,lo(_src_beg)
+ l.movhi r4,hi(_dst_beg)
+ l.ori r4,r4,lo(_dst_beg)
+ l.movhi r5,hi(_dst_end)
+ l.ori r5,r5,lo(_dst_end)
+ l.sub r5,r5,r4
+ l.sfeqi r5,0
+ l.bf 2f
+ l.nop
+1: l.lwz r6,0(r3)
+ l.sw 0(r4),r6
+ l.addi r3,r3,4
+ l.addi r4,r4,4
+ l.addi r5,r5,-4
+ l.sfgtsi r5,0
+ l.bf 1b
+ l.nop
+2:
+.endif
+
+ l.movhi r1,hi(_stack)
+ l.addi r1,r1,lo(_stack)
+ l.addi r1,r1,-4
+
+ l.movhi r3,hi(_linux_start)
+ l.ori r3,r3,lo(_linux_start)
+ l.addi r4,r0,0
+ l.jal _decompress
+ l.nop
+
+ l.addi r2,r0,0x100
+ l.jr r2
+ l.addi r2,r0,0
+
+init_mc:
+
+ l.movhi r3,hi(MC_BASE_ADD)
+ l.ori r3,r3,lo(MC_BASE_ADD)
+
+ l.addi r4,r3,MC_CSC(0)
+ l.movhi r5,hi(FLASH_BASE_ADD)
+ l.srai r5,r5,5
+ l.ori r5,r5,0x0025
+ l.sw 0(r4),r5
+
+ l.addi r4,r3,MC_TMS(0)
+ l.movhi r5,hi(FLASH_TMS_VAL)
+ l.ori r5,r5,lo(FLASH_TMS_VAL)
+ l.sw 0(r4),r5
+
+ l.addi r4,r3,MC_BA_MASK
+ l.addi r5,r0,MC_MASK_VAL
+ l.sw 0(r4),r5
+
+ l.addi r4,r3,MC_CSR
+ l.movhi r5,hi(MC_CSR_VAL)
+ l.ori r5,r5,lo(MC_CSR_VAL)
+ l.sw 0(r4),r5
+
+ l.addi r4,r3,MC_TMS(1)
+ l.movhi r5,hi(SDRAM_TMS_VAL)
+ l.ori r5,r5,lo(SDRAM_TMS_VAL)
+ l.sw 0(r4),r5
+
+ l.addi r4,r3,MC_CSC(1)
+ l.movhi r5,hi(SDRAM_BASE_ADD)
+ l.srai r5,r5,5
+ l.ori r5,r5,0x0411
+ l.sw 0(r4),r5
+
+ l.jr r9
+ l.nop
+
+_ic_enable:
+ /* Disable IC */
+ l.mfspr r13,r0,SPR_SR
+ l.addi r11,r0,-1
+ l.xori r11,r11,SPR_SR_ICE
+ l.and r11,r13,r11
+ l.mtspr r0,r11,SPR_SR
+
+ /* Invalidate IC */
+ l.addi r13,r0,0
+ l.addi r11,r0,IC_SIZE
+1:
+ l.mtspr r0,r13,SPR_ICBIR
+ l.sfne r13,r11
+ l.bf 1b
+ l.addi r13,r13,IC_LINE
+
+ /* Enable IC */
+ l.mfspr r13,r0,SPR_SR
+ l.ori r13,r13,SPR_SR_ICE
+ l.mtspr r0,r13,SPR_SR
+ l.nop
+ l.nop
+ l.nop
+ l.nop
+ l.nop
+
+ l.jr r9
+ l.nop
+
+ .global __print
+__print:
+ l.lwz r3,0(r1)
+ l.addi r4,r1,4
+# l.sys 202
+ l.nop 3
+ l.jr r9
+ l.nop
+
+
+
Index: comp.ld
===================================================================
--- comp.ld (nonexistent)
+++ comp.ld (revision 1765)
@@ -0,0 +1,45 @@
+MEMORY
+ {
+ ram : ORIGIN = 0x01000000, LENGTH = 0x00010000
+ flash : ORIGIN = 0x04000000, LENGTH = 0x00200000
+ }
+
+SECTIONS
+{
+ .reset :
+ {
+ *(.reset)
+ } > flash
+
+ .text :
+ {
+ *(.text)
+ } > flash
+
+ .linux ALIGN(0x4):
+ {
+ _linux_start = .;
+ *(.linux)
+ _linux_end = .;
+ _src_beg = .;
+ } > flash
+
+ .data :
+ AT ( ADDR (.text) + SIZEOF (.text) + SIZEOF (.linux))
+ {
+ _dst_beg = .;
+ *(.rodata)
+ *(.data)
+ _dst_end = .;
+ } > ram
+
+ .bss :
+ {
+ *(.bss)
+ } > ram
+
+ .stack ALIGN(0x10) (NOLOAD):
+ {
+ *(.stack)
+ } > ram
+}
Index: Makefile
===================================================================
--- Makefile (nonexistent)
+++ Makefile (revision 1765)
@@ -0,0 +1,28 @@
+#
+# Makefile for the linux kernel.
+#
+# Note! Dependencies are done automagically by 'make dep', which also
+# removes any old dependencies. DON'T put your own dependencies here
+# unless it's something special (ie not a .c file).
+#
+.S.o:
+ $(CC) -D__ASSEMBLY__ $(AFLAGS) -c $< -o $*.o
+
+all: board.o
+
+O_TARGET := board.o
+O_OBJS := config.o initrd.o
+
+initrd.o: initrd ../tools/bintoc ../tools/piggyback ../tools/comp reset.o uncomp.o
+ ../tools/bintoc < initrd |$(AS) -o initrd.o
+
+../tools/bintoc: ../tools/bintoc.c
+ $(HOSTCC) $(HOSTCFLAGS) -o ../tools/bintoc ../tools/bintoc.c
+
+../tools/piggyback: ../tools/piggyback.c
+ $(HOSTCC) $(HOSTCFLAGS) -o ../tools/piggyback ../tools/piggyback.c
+
+../tools/comp: ../tools/comp.c
+ $(HOSTCC) $(HOSTCFLAGS) -o ../tools/comp ../tools/comp.c
+
+include $(TOPDIR)/Rules.make
Index: config.c
===================================================================
--- config.c (nonexistent)
+++ config.c (revision 1765)
@@ -0,0 +1,91 @@
+/*
+ * linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ *
+ * Based on m68knommu/platform/xx/config.c
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+extern void register_console(void (*proc)(const char *));
+
+/* Tick timer period */
+unsigned long tick_period = SYS_TICK_PER;
+
+void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
+{
+ /* Set counter period, enable timer and interrupt */
+ mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (SYS_TICK_PER & SPR_TTMR_PERIOD));
+}
+
+void BSP_tick(void)
+{
+ mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (SYS_TICK_PER & SPR_TTMR_PERIOD));
+}
+
+unsigned long BSP_gettimeoffset (void)
+{
+ return 0;
+}
+
+void BSP_gettod (int *yearp, int *monp, int *dayp,
+ int *hourp, int *minp, int *secp)
+{
+}
+
+int BSP_hwclk(int op, struct hwclk_time *t)
+{
+ if (!op) {
+ /* read */
+ } else {
+ /* write */
+ }
+ return 0;
+}
+
+int BSP_set_clock_mmss (unsigned long nowtime)
+{
+#if 0
+ short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
+
+ tod->second1 = real_seconds / 10;
+ tod->second2 = real_seconds % 10;
+ tod->minute1 = real_minutes / 10;
+ tod->minute2 = real_minutes % 10;
+#endif
+ return 0;
+}
+
+void BSP_reset (void)
+{
+ cli();
+}
+
+void config_BSP(char *command, int len)
+{
+ mach_sched_init = BSP_sched_init;
+ mach_tick = BSP_tick;
+ mach_gettimeoffset = BSP_gettimeoffset;
+ mach_gettod = BSP_gettod;
+ mach_hwclk = NULL;
+ mach_set_clock_mmss = NULL;
+ mach_mksound = NULL;
+ mach_reset = BSP_reset;
+ mach_debug_init = NULL;
+}
+
+
Index: ext2
===================================================================
--- ext2 (nonexistent)
+++ ext2 (revision 1765)
@@ -0,0 +1,1157 @@
+ @ &