Browse Source

They can come back when they have someone to support them.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
b2909e547d
89 changed files with 0 additions and 8563 deletions
  1. 0
    29
      src/arch/armnommu/Config
  2. 0
    58
      src/arch/armnommu/Makefile
  3. 0
    79
      src/arch/armnommu/core/arm_timer.c
  4. 0
    55
      src/arch/armnommu/core/etherboot.lds
  5. 0
    105
      src/arch/armnommu/core/lib1funcs.c
  6. 0
    27
      src/arch/armnommu/core/mem.c
  7. 0
    48
      src/arch/armnommu/core/raw_loader.c
  8. 0
    66
      src/arch/armnommu/core/serial.c
  9. 0
    33
      src/arch/armnommu/core/setjmp.S
  10. 0
    184
      src/arch/armnommu/core/start.S
  11. 0
    592
      src/arch/armnommu/drivers/net/p2001_eth.c
  12. 0
    47
      src/arch/armnommu/include/bits/byteswap.h
  13. 0
    13
      src/arch/armnommu/include/bits/cpu.h
  14. 0
    18
      src/arch/armnommu/include/bits/elf.h
  15. 0
    17
      src/arch/armnommu/include/bits/endian.h
  16. 0
    11
      src/arch/armnommu/include/bits/string.h
  17. 0
    1
      src/arch/armnommu/include/callbacks_arch.h
  18. 0
    170
      src/arch/armnommu/include/hardware.h
  19. 0
    25
      src/arch/armnommu/include/hooks.h
  20. 0
    27
      src/arch/armnommu/include/io.h
  21. 0
    15
      src/arch/armnommu/include/latch.h
  22. 0
    43
      src/arch/armnommu/include/limits.h
  23. 0
    23
      src/arch/armnommu/include/setjmp.h
  24. 0
    35
      src/arch/armnommu/include/stdint.h
  25. 0
    7
      src/arch/e1/Config
  26. 0
    70
      src/arch/e1/Makefile
  27. 0
    67
      src/arch/e1/Makefile.working
  28. 0
    80
      src/arch/e1/README
  29. 0
    176
      src/arch/e1/core/coff_loader.c
  30. 0
    70
      src/arch/e1/core/e132_xs.c
  31. 0
    97
      src/arch/e1/core/e1_timer.c
  32. 0
    126
      src/arch/e1/core/etherboot.lds
  33. 0
    35
      src/arch/e1/core/longjmp.c
  34. 0
    54
      src/arch/e1/core/memcmp.S
  35. 0
    79
      src/arch/e1/core/memcpy.S
  36. 0
    47
      src/arch/e1/core/memset.S
  37. 0
    26
      src/arch/e1/core/setjmp.c
  38. 0
    111
      src/arch/e1/core/start.S
  39. 0
    76
      src/arch/e1/core/strcmp.S
  40. 0
    39
      src/arch/e1/include/bits/byteswap.h
  41. 0
    6
      src/arch/e1/include/bits/cpu.h
  42. 0
    6
      src/arch/e1/include/bits/elf.h
  43. 0
    6
      src/arch/e1/include/bits/endian.h
  44. 0
    35
      src/arch/e1/include/bits/string.h
  45. 0
    22
      src/arch/e1/include/e132_xs_board.h
  46. 0
    9
      src/arch/e1/include/hooks.h
  47. 0
    210
      src/arch/e1/include/io.h
  48. 0
    12
      src/arch/e1/include/latch.h
  49. 0
    34
      src/arch/e1/include/limits.h
  50. 0
    23
      src/arch/e1/include/setjmp.h
  51. 0
    28
      src/arch/e1/include/stdint.h
  52. 0
    22
      src/arch/ia64/Config
  53. 0
    125
      src/arch/ia64/Makefile
  54. 0
    68
      src/arch/ia64/core/__call.S
  55. 0
    1026
      src/arch/ia64/core/efi.c
  56. 0
    82
      src/arch/ia64/core/etherboot.lds
  57. 0
    92
      src/arch/ia64/core/ia64_timer.c
  58. 0
    86
      src/arch/ia64/core/idiv32.S
  59. 0
    96
      src/arch/ia64/core/idiv64.S
  60. 0
    163
      src/arch/ia64/core/longjmp.S
  61. 0
    244
      src/arch/ia64/core/memmove.S
  62. 0
    133
      src/arch/ia64/core/memset.S
  63. 0
    84
      src/arch/ia64/core/pal.c
  64. 0
    62
      src/arch/ia64/core/pci_io.c
  65. 0
    133
      src/arch/ia64/core/reloc.S
  66. 0
    92
      src/arch/ia64/core/relocate_to.S
  67. 0
    278
      src/arch/ia64/core/sal.c
  68. 0
    173
      src/arch/ia64/core/setjmp.S
  69. 0
    28
      src/arch/ia64/core/start.S
  70. 0
    1079
      src/arch/ia64/drivers/net/undi_nii.c
  71. 0
    36
      src/arch/ia64/include/bits/byteswap.h
  72. 0
    6
      src/arch/ia64/include/bits/cpu.h
  73. 0
    11
      src/arch/ia64/include/bits/elf.h
  74. 0
    6
      src/arch/ia64/include/bits/endian.h
  75. 0
    6
      src/arch/ia64/include/bits/string.h
  76. 0
    12
      src/arch/ia64/include/hooks.h
  77. 0
    228
      src/arch/ia64/include/io.h
  78. 0
    11
      src/arch/ia64/include/latch.h
  79. 0
    57
      src/arch/ia64/include/limits.h
  80. 0
    11
      src/arch/ia64/include/pal.h
  81. 0
    29
      src/arch/ia64/include/sal.h
  82. 0
    13
      src/arch/ia64/include/setjmp.h
  83. 0
    28
      src/arch/ia64/include/stdint.h
  84. 0
    63
      src/arch/ia64/prefix/apply_efi_prefix.pl
  85. 0
    198
      src/arch/ia64/prefix/apply_unnrv2b_prefix.pl
  86. 0
    195
      src/arch/ia64/prefix/efi_prefix.S
  87. 0
    91
      src/arch/ia64/prefix/efi_prefix.lds
  88. 0
    196
      src/arch/ia64/prefix/unnrv2b.S
  89. 0
    28
      src/arch/ia64/prefix/unnrv2b.lds

+ 0
- 29
src/arch/armnommu/Config View File

@@ -1,29 +0,0 @@
1
-# Config for armnommu Etherboot
2
-#
3
-
4
-# For a clean compilation, switch in global Config
5
-# off: -DCONFIG_PCI, -DTAGGED_IMAGE, -DELF_IMAGE, -DPXE*, -DRELOCATE and INCLUDE_FILO
6
-# on : -DRAW_IMAGE
7
-
8
-# Serial line settings
9
-CFLAGS+= -DCONSOLE_SERIAL -DCONSPEED=57600
10
-
11
-# System Frequency
12
-CFLAGS+= -DSYSCLK=73728000
13
-
14
-# Image Download Address
15
-CFLAGS+= -DRAWADDR=0x40100000
16
-
17
-# NIC Debug Outputs
18
-#CFLAGS+= -DDEBUG_NIC
19
-
20
-# Reduced Media Independent Interface
21
-# MAZBR LPEC2001: MII	(Intel LXT971ALE at 0..1)
22
-# Elmeg D@VOS   : RMII	(Altima AC104-QF at 4..7)
23
-# Telekom XI521 : RMII	(Altima AC104-QF at 4..7)
24
-#CFLAGS+= -DRMII
25
-
26
-# Fixed MAC address
27
-# p2001_eth has no flash and fixed mac address
28
-#CFLAGS+=	-DMAC_HW_ADDR_DRV="'H','Y','L','N','X','1'"
29
-CFLAGS+=	-DMAC_HW_ADDR_DRV="0x00,0x09,0x4F,0x00,0x00,0x02"

+ 0
- 58
src/arch/armnommu/Makefile View File

@@ -1,58 +0,0 @@
1
-ARCH_FORMAT=	armnommu
2
-
3
-ROMLIMIT=	20480
4
-CHECKSIZE=	{ read d1; read d1 d2 d3 size d4; [ $$size -gt $(ROMLIMIT) ] &&\
5
-	{ $(RM) $@; echo "ERROR: code size exceeds limit!"; exit 1; }; exit 0; }
6
-
7
-START=	$(BIN)/start.o
8
-
9
-SRCS+=	arch/armnommu/core/arm_timer.c
10
-SRCS+=	arch/armnommu/core/start.S
11
-SRCS+=	arch/armnommu/core/serial.c
12
-SRCS+=	arch/armnommu/core/mem.c
13
-SRCS+=	arch/armnommu/core/setjmp.S
14
-SRCS+=	arch/armnommu/drivers/net/p2001_eth.c
15
-
16
-# not greater than 100kB
17
-ROMLIMIT:=1024000
18
-
19
-include		$(BIN)/Roms
20
-
21
-ROMS= $(BIN)/p2001_eth.rom
22
-IMGS= $(BIN)/p2001_eth.img
23
-
24
-
25
-allfiles:	$(ROMS)
26
-
27
-BOBJS+=		$(BIN)/arm_timer.o
28
-BOBJS+=		$(BIN)/serial.o
29
-BOBJS+=		$(BIN)/mem.o
30
-BOBJS+=		$(BIN)/setjmp.o
31
-BOBJS+=		$(BIN)/lib1funcs.o
32
-
33
-# Utilities
34
-
35
-$(BIN)/nrv2b:	util/nrv2b.c
36
-	$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
37
-
38
-# Pattern Rules
39
-# General for compiling/assembly source files
40
-$(BIN)/%.o:	arch/armnommu/core/%.c $(MAKEDEPS)
41
-	$(CC) $(CFLAGS) -o $@ -c $<
42
-
43
-$(BIN)/%.o:	arch/armnommu/drivers/net/%.c $(MAKEDEPS)
44
-	$(CC) $(CFLAGS) -o $@ -c $<
45
-
46
-$(BIN)/%.S:	arch/armnommu/core/%.c $(MAKEDEPS)
47
-	$(CC) $(CFLAGS) -S -o $@ -c $<
48
-
49
-$(BIN)/%.o:	arch/armnommu/core/%.S $(MAKEDEPS)
50
-	$(CPP) $(CFLAGS) -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
51
-
52
-# general ruls for generating .img files
53
-$(BIN)/%.tmp: $(BIN)/%.o $(START) $(BIN)/config.o arch/$(ARCH)/core/etherboot.lds $(LIBS) $(STDDEPS) $(MAKEDEPS)
54
-	$(LD) $(LDFLAGS) -T arch/$(ARCH)/core/etherboot.lds -o $@ $(START) $(BIN)/config.o $< $(LIBS)
55
-	@$(SIZE) $@ | $(CHECKSIZE)
56
-
57
-$(BIN)/%.img: $(BIN)/%.tmp $(MAKEDEPS)
58
-	$(OBJCOPY) -O binary $< $@

+ 0
- 79
src/arch/armnommu/core/arm_timer.c View File

@@ -1,79 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#include "etherboot.h"
9
-#include "timer.h"
10
-#include "latch.h"
11
-#include "hardware.h"
12
-#include "init.h"
13
-
14
-/* get timer returns the contents of the timer */
15
-static unsigned long get_timer(void)
16
-{
17
-	return P2001_TIMER->Freerun_Timer;
18
-}
19
-
20
-/* ------ Calibrate the TSC ------- 
21
- * Time how long it takes to excute a loop that runs in known time.
22
- * And find the convertion needed to get to CLOCK_TICK_RATE
23
- */
24
-
25
-static unsigned long configure_timer(void)
26
-{
27
-	return (1);
28
-}
29
-
30
-static unsigned long clocks_per_tick = 1;
31
-
32
-static void setup_timers(void)
33
-{
34
-	if (!clocks_per_tick) {
35
-		clocks_per_tick = configure_timer();
36
-	}
37
-}
38
-
39
-unsigned long currticks(void)
40
-{
41
-	return get_timer(); /* /clocks_per_tick */
42
-}
43
-
44
-static unsigned long timer_timeout;
45
-static int __timer_running(void)
46
-{
47
-	return get_timer() < timer_timeout;
48
-}
49
-
50
-void udelay(unsigned int usecs)
51
-{
52
-	unsigned long now;
53
-	now = get_timer();
54
-	timer_timeout = now + usecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000));
55
-	while(__timer_running());
56
-}
57
-void ndelay(unsigned int nsecs)
58
-{
59
-	unsigned long now;
60
-	now = get_timer();
61
-	timer_timeout = now + nsecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000*1000));
62
-	while(__timer_running());
63
-}
64
-
65
-void load_timer2(unsigned int timer2_ticks)
66
-{
67
-	unsigned long now;
68
-	unsigned long clocks;
69
-	now = get_timer();
70
-	clocks = timer2_ticks * ((clocks_per_tick * TICKS_PER_SEC)/CLOCK_TICK_RATE);
71
-	timer_timeout = now + clocks;
72
-}
73
-
74
-int timer2_running(void)
75
-{
76
-	return __timer_running();
77
-}
78
-
79
-INIT_FN ( INIT_TIMERS, setup_timers, NULL, NULL );

+ 0
- 55
src/arch/armnommu/core/etherboot.lds View File

@@ -1,55 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
9
-OUTPUT_ARCH(arm)
10
-ENTRY(_start)
11
-SECTIONS
12
-{
13
-	/*. = 0x00000000;*/	/* PIC */
14
-	/*. = 0x00000400;*/	/* ROM Bootloader */
15
-	. = 0x40000000;		/* SDRAM */
16
-
17
-	. = ALIGN(4);
18
-	_text = . ;
19
-	.text      :
20
-	{
21
-	  _start = .;
22
-	  _virt_start = .;
23
-	  bin/start.o	(.text)
24
-	  *(.text)
25
-
26
-	  . = ALIGN(16);
27
-	  isa_drivers = . ;
28
-	  *(.drivers.isa);
29
-	  isa_drivers_end = . ;	  
30
-	}
31
-
32
-	. = ALIGN(4);
33
-	.rodata : { *(.rodata) }
34
-
35
-	. = ALIGN(4);
36
-	.data : { *(.data) }
37
-
38
-	. = ALIGN(4);
39
-	.got : { *(.got) }
40
-
41
-	. = ALIGN(4);
42
-	_bss = . ;
43
-	.bss : { *(.bss) }
44
-
45
-	. = ALIGN(4);
46
-	_ebss = .;
47
-	_end = .;
48
-
49
-	. = ALIGN(16);
50
-	.text :
51
-	{
52
-		*(.dma.desc);
53
-		*(.dma.buffer);
54
-	}
55
-}

+ 0
- 105
src/arch/armnommu/core/lib1funcs.c View File

@@ -1,105 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-
9
-
10
-/*
11
- * from gcc/config/udivmodsi4.c
12
- */
13
-unsigned long
14
-udivmodsi4(unsigned long num, unsigned long den, int modwanted)
15
-{
16
-  unsigned long bit = 1;
17
-  unsigned long res = 0;
18
-
19
-  while (den < num && bit && !(den & (1L<<31)))
20
-    {
21
-      den <<=1;
22
-      bit <<=1;
23
-    }
24
-  while (bit)
25
-    {
26
-      if (num >= den)
27
-	{
28
-	  num -= den;
29
-	  res |= bit;
30
-	}
31
-      bit >>=1;
32
-      den >>=1;
33
-    }
34
-  if (modwanted) return num;
35
-  return res;
36
-}
37
-
38
-
39
-/*
40
- * from gcc/config/udivmod.c
41
- */
42
-long
43
-__udivsi3 (long a, long b)
44
-{
45
-  return udivmodsi4 (a, b, 0);
46
-}
47
-
48
-long
49
-__umodsi3 (long a, long b)
50
-{
51
-  return udivmodsi4 (a, b, 1);
52
-}
53
-
54
-
55
-/*
56
- * from gcc/config/divmod.c
57
- */
58
-long
59
-__divsi3 (long a, long b)
60
-{
61
-  int neg = 0;
62
-  long res;
63
-
64
-  if (a < 0)
65
-    {
66
-      a = -a;
67
-      neg = !neg;
68
-    }
69
-
70
-  if (b < 0)
71
-    {
72
-      b = -b;
73
-      neg = !neg;
74
-    }
75
-
76
-  res = udivmodsi4 (a, b, 0);
77
-
78
-  if (neg)
79
-    res = -res;
80
-
81
-  return res;
82
-}
83
-
84
-long
85
-__modsi3 (long a, long b)
86
-{
87
-  int neg = 0;
88
-  long res;
89
-
90
-  if (a < 0)
91
-    {
92
-      a = -a;
93
-      neg = 1;
94
-    }
95
-
96
-  if (b < 0)
97
-    b = -b;
98
-
99
-  res = udivmodsi4 (a, b, 1);
100
-
101
-  if (neg)
102
-    res = -res;
103
-
104
-  return res;
105
-}

+ 0
- 27
src/arch/armnommu/core/mem.c View File

@@ -1,27 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#include "hooks.h"
9
-#include "io.h"
10
-#include "etherboot.h"
11
-
12
-struct meminfo meminfo;
13
-void get_memsizes(void)
14
-{
15
-/* We initialize the meminfo structure 
16
- * according to our development board's specs
17
- * We do not have a way to automatically probe the 
18
- * memspace instead we initialize it manually
19
- */
20
-	meminfo.basememsize = 0x00000000;
21
-	meminfo.memsize     = 0x00008000;
22
-	meminfo.map_count   = 1;
23
-
24
-	meminfo.map[0].addr = 0x40000000;
25
-	meminfo.map[0].size = 0x01000000;
26
-	meminfo.map[0].type = E820_RAM;
27
-}

+ 0
- 48
src/arch/armnommu/core/raw_loader.c View File

@@ -1,48 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifdef RAW_IMAGE
9
-static unsigned long raw_load_addr;
10
-
11
-int mach_boot(register unsigned long entry_point)
12
-{
13
-	void (*fnc)(void) = (void *) entry_point;
14
-	// r0 = 0
15
-	// r1 = 625 (machine nr. MACH_TYPE_P2001)
16
-	(*fnc)();
17
-
18
-	return 0; /* We should never reach this point ! */
19
-}
20
-
21
-static sector_t raw_download(unsigned char *data, unsigned int len, int eof)
22
-{
23
-	memcpy(phys_to_virt(raw_load_addr), data, len);
24
-	raw_load_addr += len;
25
-	if (!eof)
26
-		return 0;
27
-
28
-	done(1);
29
-	printf("Starting program.\n");
30
-	mach_boot(RAWADDR);
31
-	printf("Bootsector returned?");
32
-	longjmp(restart_etherboot, -2);
33
-	return 1;
34
-}
35
-
36
-static os_download_t raw_probe(unsigned char *data __unused, unsigned int len __unused)
37
-{
38
-	printf("(RAW");
39
-	// probe something here...
40
-	printf(")... \n");
41
-
42
-	//raw_load_addr = phys_to_virt(_end);
43
-	raw_load_addr = RAWADDR;
44
-	printf("Writing image to 0x%x\n", raw_load_addr);
45
-	return raw_download;
46
-}
47
-
48
-#endif

+ 0
- 66
src/arch/armnommu/core/serial.c View File

@@ -1,66 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#include "etherboot.h"
9
-#include "hardware.h"
10
-#ifdef	CONSOLE_SERIAL
11
-
12
-/*
13
- * void serial_putc(int ch);
14
- *	Write character `ch' to port UART_BASE.
15
- */
16
-void serial_putc(int ch)
17
-{
18
-	/* wait for room in the 32 byte tx FIFO */
19
-	while ((P2001_UART->r.STATUS & 0x3f) > /* 30 */ 0) ;
20
-	P2001_UART->w.TX[0] = ch & 0xff;
21
-}
22
-
23
-/*
24
- * int serial_getc(void);
25
- *	Read a character from port UART_BASE.
26
- */
27
-int serial_getc(void)
28
-{
29
-	while (((P2001_UART->r.STATUS >> 6) & 0x3f) == 0) ;
30
-	return P2001_UART->r.RX[0] & 0xff;
31
-}
32
-
33
-/*
34
- * int serial_ischar(void);
35
- *       If there is a character in the input buffer of port UART_BASE,
36
- *       return nonzero; otherwise return 0.
37
- */
38
-int serial_ischar(void)
39
-{
40
-	return (P2001_UART->r.STATUS >> 6) & 0x3f;
41
-}
42
-
43
-/*
44
- * int serial_init(void);
45
- *	Initialize port to speed 57.600, line settings 8N1.
46
- */
47
-int serial_init(void)
48
-{
49
-	static unsigned int N;
50
-	// const M=3
51
-	P2001_UART->w.Clear = 0;		// clear
52
-	N = ((SYSCLK/8)*3)/CONSPEED;
53
-	P2001_UART->w.Baudrate = (N<<16)+3;	// set 57.600 BAUD
54
-	P2001_UART->w.Config = 0xcc100;		// set 8N1, *water = 12
55
-	return 1;
56
-}
57
-
58
-/*
59
- * void serial_fini(void);
60
- *	Cleanup our use of the serial port, in particular flush the
61
- *	output buffer so we don't accidentially loose characters.
62
- */
63
-void serial_fini(void)
64
-{
65
-}
66
-#endif

+ 0
- 33
src/arch/armnommu/core/setjmp.S View File

@@ -1,33 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-.text
9
-
10
-.global sigsetjmp;
11
-.type sigsetjmp,%function
12
-.align 4;
13
-sigsetjmp:
14
-	/* Save registers */
15
-	stmia	r0, {v1-v6, sl, fp, sp, lr}
16
-
17
-	mov	r0, #0
18
-	bx	lr
19
-.size sigsetjmp,.-sigsetjmp;
20
-
21
-
22
-
23
-.global longjmp;
24
-.type longjmp,%function
25
-.align 4;
26
-longjmp:
27
-	mov	ip, r0		/* save jmp_buf pointer */
28
-
29
-	movs	r0, r1		/* get the return value in place */
30
-	moveq	r0, #1		/* can't let setjmp() return zero! */
31
-
32
-	ldmia	ip, {v1-v6, sl, fp, sp, pc}
33
-.size longjmp,.-longjmp;

+ 0
- 184
src/arch/armnommu/core/start.S View File

@@ -1,184 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-.global _start
9
-
10
-/* Mode definitions */
11
-#define Mode_USR	0x10
12
-#define Mode_FIQ	0x11
13
-#define Mode_IRQ	0x12
14
-#define Mode_SVC	0x13
15
-#define Mode_ABT	0x17
16
-#define Mode_UNDEF	0x1B
17
-#define Mode_SYS	0x1F				// only available on ARM Arch. v4
18
-#define I_Bit		0x80
19
-#define F_Bit		0x40
20
-
21
-/* LPEC register definitions */
22
-#define Adr_SYS_BASE			0x00100000
23
-#define REL_Adr_SDRAM_Ctrl		0x10
24
-#define REL_Adr_ExtMem_Ctrl		0x14
25
-#define REL_Adr_WaitState_Ext		0x18
26
-#define REL_Adr_WaitState_Asic		0x1c
27
-#define Adr_TIMER_BASE			0x00110000
28
-#define REL_Adr_Timer12_PreDiv		0x0c
29
-#define REL_Adr_PLL_12000_config	0x30
30
-#define REL_Adr_PLL_12288_config	0x34
31
-#define REL_Adr_DIV_12288_config	0x38
32
-#define REL_Adr_FSC_CONFIG		0x44
33
-#define Adr_GPIO_BASE			0x00120000
34
-#define REL_Adr_NRES_OUT		0x2c
35
-
36
-
37
-
38
-/* Define entry point */
39
-.arm							// Next instruction will be ARM
40
-_start:
41
-
42
-/*
43
- * Initialize memory system
44
- */
45
-
46
-
47
-/*
48
- * Initialize stack pointer registers
49
- */
50
-
51
-/* Enter SVC mode and set up the SVC stack pointer */
52
-	mov	r0, #(Mode_SVC|I_Bit|F_Bit)
53
-	msr	cpsr_c, r0
54
-	ldr	sp, SP_SVC
55
-
56
-
57
-/*
58
- * Initialize critical IO devices
59
- */
60
-
61
-	/* watchdog off */
62
-	mov	r0, #Adr_TIMER_BASE
63
-	ldr	r1, Timer12_PreDiv
64
-	str	r1, [r0, #REL_Adr_Timer12_PreDiv]
65
-	
66
-	/* NRES=1 */
67
-	mov	r0, #Adr_GPIO_BASE
68
-	ldr	r1, NRES_OUT
69
-	str	r1, [r0, #REL_Adr_NRES_OUT]
70
-
71
-	/* ExtMem */
72
-	mov	r0, #Adr_SYS_BASE
73
-	ldr	r1, ExtMem_Ctrl
74
-	str	r1, [r0, #REL_Adr_ExtMem_Ctrl]
75
-
76
-	/* SDRAM */
77
-	mov	r0, #Adr_SYS_BASE
78
-	ldr	r1, SDRAM_Ctrl
79
-	str	r1, [r0, #REL_Adr_SDRAM_Ctrl]
80
-/*
81
-_wait_sdram_ctrl:
82
-	ldr	r1, [r0]
83
-	tst	r1, #0x20000
84
-	beq	_wait_sdram_ctrl
85
-*/
86
-
87
-	/* WaitState_Ext */
88
-	ldr	r1, WaitState_Ext
89
-	str	r1, [r0, #REL_Adr_WaitState_Ext]
90
-	/* WaitState_Asic */
91
-	ldr	r1, WaitState_Asic
92
-	str	r1, [r0, #REL_Adr_WaitState_Asic]
93
-
94
-	/* PLL_12288 */
95
-	mov	r0, #Adr_TIMER_BASE
96
-	ldr	r1, PLL_12288_config
97
-	str	r1, [r0, #REL_Adr_PLL_12288_config]
98
-	/* DIV_12288 */
99
-	ldr	r1, DIV_12288_config
100
-	str	r1, [r0, #REL_Adr_DIV_12288_config]
101
-	/* PLL_12200 */
102
-	ldr	r1, PLL_12000_config
103
-	str	r1, [r0, #REL_Adr_PLL_12000_config]
104
-
105
-	/* FSC_CONFIG */
106
-	ldr	r1, [r0, #REL_Adr_FSC_CONFIG]
107
-	bic	r1, r1, #0x07
108
-	ldr	r2, FSC_CONFIG
109
-	orr	r1, r1, r2
110
-	str	r1, [r0, #REL_Adr_FSC_CONFIG]
111
-
112
-
113
-/*
114
- * Initialize interrupt system variables here
115
- */
116
-
117
-
118
-/*
119
- * Initialize memory required by main C code
120
- */
121
-	
122
-
123
-/* jump to main program */
124
-	mov	r0, #0
125
-	b	main
126
-
127
-
128
-Timer12_PreDiv:
129
-	.word	0x40bb0000	/* watchdog off */
130
-NRES_OUT:
131
-	.word	0x00000003	/* NRES_OUT_DRV=1, NRES_OUT_DAT=1 */
132
-
133
-#if SYSCLK == 73728000
134
-ExtMem_Ctrl:
135
-	.word	0x000000e8	/* fuer FPGA 32 Bit konfiguriert */
136
-SDRAM_Ctrl:
137
-//	.word	0x28fc0037	/* default */
138
-	.word	0xaef40027	/* p2001_bit_compact */
139
-WaitState_Ext:
140
-	.word	0xa0001245	/* fuer 73 MHz */
141
-//	.word	0x0000fff3	/* rom bootloader */
142
-WaitState_Asic:
143
-	.word	0x00ff8a5f	/* fuer 85 MHz */
144
-//	.word	0x00000203	/* rom bootloader */
145
-PLL_12288_config:
146
-	.word	0x00000004	/* fuer 73 MHz */
147
-DIV_12288_config:
148
-	.word	0x00010601	/* fuer 73 MHz */
149
-PLL_12000_config:
150
-	.word	0x10004e75	/* fuer 85 MHz */
151
-FSC_CONFIG:
152
-	.word	0xc0000005	/* fuer 73 MHz */
153
-#else
154
-#error "Please define proper timings and wait states for that sysclk."
155
-#endif
156
-
157
-SP_SVC:
158
-	.word	0x40fffffc
159
-
160
-
161
-
162
-#ifndef	NORELOCATE
163
-/**************************************************************************
164
-RELOCATE_TO - relocate etherboot to the specified address
165
-**************************************************************************/
166
-	.global relocate_to
167
-
168
-relocate_to:
169
-	ldr	r1, =_start
170
-	ldr	r2, =_end
171
-
172
-	/* while (r1 < r2) { *(r0++) = *(r1++) } */
173
-_relocate_loop:
174
-	cmp	r1, r2
175
-	ldrcc	r3, [r1], #4
176
-	strcc	r3, [r0], #4
177
-	bcc	_relocate_loop
178
-	mov	pc, lr
179
-#endif
180
-
181
-
182
-.global __gccmain
183
-__gccmain:
184
-	mov	pc, lr		/* return from subroutine */

+ 0
- 592
src/arch/armnommu/drivers/net/p2001_eth.c View File

@@ -1,592 +0,0 @@
1
-/**************************************************************************
2
- * Etherboot -  BOOTP/TFTP Bootstrap Program
3
- * P2001 NIC driver for Etherboot
4
- **************************************************************************/
5
-
6
-/*
7
- *  Copyright (C) 2005 Tobias Lorenz
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
12
- */
13
-
14
-/* to get some global routines like printf */
15
-#include "etherboot.h"
16
-/* to get the interface to the body of the program */
17
-#include "nic.h"
18
-/* to get the ISA support functions, if this is an ISA NIC */
19
-#include "isa.h"
20
-
21
-#include "hardware.h"
22
-#include "mii.h"
23
-#include "timer.h"
24
-
25
-
26
-/* NIC specific static variables go here */
27
-static unsigned char MAC_HW_ADDR[6]={MAC_HW_ADDR_DRV};
28
-
29
-/* DMA descriptors and buffers */
30
-#define NUM_RX_DESC     4	/* Number of Rx descriptor registers. */
31
-#define DMA_BUF_SIZE	2048	/* Buffer size */
32
-static DMA_DSC txd              __attribute__ ((__section__(".dma.desc")));
33
-static DMA_DSC rxd[NUM_RX_DESC] __attribute__ ((__section__(".dma.desc")));
34
-static char rxb[NUM_RX_DESC * DMA_BUF_SIZE] __attribute__ ((__section__(".dma.buffer")));
35
-static char txb[              DMA_BUF_SIZE] __attribute__ ((__section__(".dma.buffer")));
36
-static unsigned int cur_rx;
37
-
38
-/* Device selectors */
39
-static unsigned int cur_channel;	// DMA channel    : 0..3
40
-static unsigned int cur_phy;		// PHY Address    : 0..31
41
-static P2001_ETH_regs_ptr EU;		// Ethernet Unit  : 0x0018_000 with _=0..3
42
-
43
-/* mdio handling */
44
-static int          p2001_eth_mdio_read (int phy_id, int location);
45
-static void         p2001_eth_mdio_write(int phy_id, int location, int val);
46
-
47
-/* net_device functions */
48
-static int          p2001_eth_poll      (struct nic *nic, int retrieve);
49
-static void         p2001_eth_transmit  (struct nic *nic, const char *d,
50
-					unsigned int t, unsigned int s, const char *p);
51
-
52
-static void         p2001_eth_irq       (struct nic *nic, irq_action_t action);
53
-
54
-static void         p2001_eth_init      ();
55
-static void         p2001_eth_disable   (struct dev *dev);
56
-
57
-static int          p2001_eth_check_link(unsigned int phy);
58
-static int          link;
59
-static void         p2001_eth_phyreset  ();
60
-static int          p2001_eth_probe     (struct dev *dev, unsigned short *probe_addrs __unused);
61
-
62
-/* Supported MII list */
63
-static struct mii_chip_info {
64
-	const char * name;
65
-	unsigned int physid;	// (MII_PHYSID2 << 16) | MII_PHYSID1
66
-} mii_chip_table[] = {
67
-	{ "Intel LXT971A",	0x78e20013 },
68
-	{ "Altima AC104-QF",	0x55410022 },
69
-	{NULL,0},
70
-};
71
-
72
-
73
-
74
-/**************************************************************************
75
- * PHY MANAGEMENT UNIT - Read/write
76
- **************************************************************************/
77
-
78
-/**
79
- *	mdio_read - read MII PHY register
80
- *	@dev: the net device to read
81
- *	@regadr: the phy register id to read
82
- *
83
- *	Read MII registers through MDIO and MDC
84
- *	using MDIO management frame structure and protocol(defined by ISO/IEC).
85
- */
86
-static int p2001_eth_mdio_read(int phy_id, int location)
87
-{
88
-	int result, boguscnt = 1000;
89
-
90
-	do {
91
-		/* Warten bis Hardware inaktiv (MIU = "0") */
92
-		while (P2001_MU->MU_CNTL & 0x8000)
93
-			barrier();
94
-
95
-		/* Schreiben MU_CNTL */
96
-		P2001_MU->MU_CNTL = location + (phy_id<<5) + (2<<10);
97
-
98
-		/* Warten bis Hardware aktiv (MIU = "1") */
99
-		while ((P2001_MU->MU_CNTL & 0x8000) == 0)
100
-			barrier();
101
-		//asm("nop \r\n nop");
102
-
103
-		/* Warten bis Hardware inaktiv (MIU = "0") */
104
-		while (P2001_MU->MU_CNTL & 0x8000)
105
-			barrier();
106
-
107
-		/* Fehler, wenn MDIO Read Error (MRE = "1") */
108
-	} while ((P2001_MU->MU_CNTL & 0x4000) && (--boguscnt > 0));
109
-
110
-	/* Lesen MU_DATA */
111
-	result = P2001_MU->MU_DATA;
112
-
113
-	if (boguscnt == 0)
114
-		return 0;
115
-	if ((result & 0xffff) == 0xffff)
116
-		return 0;
117
-
118
-	return result & 0xffff;
119
-}
120
-
121
-
122
-/**
123
- *	mdio_write - write MII PHY register
124
- *	@dev: the net device to write
125
- *	@regadr: the phy register id to write
126
- *	@value: the register value to write with
127
- *
128
- *	Write MII registers with @value through MDIO and MDC
129
- *	using MDIO management frame structure and protocol(defined by ISO/IEC)
130
- */
131
-static void p2001_eth_mdio_write(int phy_id, int location, int val)
132
-{
133
-	/* Warten bis Hardware inaktiv (MIU = "0") */
134
-	while (P2001_MU->MU_CNTL & 0x8000)
135
-		barrier();
136
-
137
-	/* Schreiben MU_DATA */
138
-	P2001_MU->MU_DATA = val;
139
-
140
-	/* Schreiben MU_CNTL */
141
-	P2001_MU->MU_CNTL = location + (phy_id<<5) + (1<<10);
142
-
143
-	/* Warten bis Hardware aktiv (MIU = "1") */
144
-	while ((P2001_MU->MU_CNTL & 0x8000) == 0)
145
-		barrier();
146
-	//asm("nop \r\n nop");
147
-
148
-	/* Warten bis Hardware inaktiv (MIU = "0") */
149
-	while (P2001_MU->MU_CNTL & 0x8000)
150
-		barrier();
151
-}
152
-
153
-
154
-
155
-/**************************************************************************
156
- * POLL - Wait for a frame
157
- **************************************************************************/
158
-
159
-/* Function: p2001_eth_poll
160
- *
161
- * Description: checks for a received packet and returns it if found.
162
- *
163
- * Arguments: struct nic *nic:          NIC data structure
164
- *
165
- * Returns:   1 if a packet was received.
166
- *            0 if no pacet was received.
167
- *
168
- * Side effects:
169
- *            Returns (copies) the packet to the array nic->packet.
170
- *            Returns the length of the packet in nic->packetlen.
171
- */
172
-static int p2001_eth_poll(struct nic *nic, int retrieve)
173
-{
174
-	/* return true if there's an ethernet packet ready to read */
175
-	/* nic->packet should contain data on return */
176
-	/* nic->packetlen should contain length of data */
177
-
178
-	int retstat = 0;
179
-
180
-	if (rxd[cur_rx].stat & (1<<31))	// OWN
181
-		return retstat;
182
-
183
-	if (!retrieve)
184
-		return 1;
185
-
186
-	nic->packetlen = rxd[cur_rx].cntl & 0xffff;
187
-
188
-	if (rxd[cur_rx].stat & ((1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22))) {
189
-		/* corrupted packet received */
190
-		printf("p2001_eth_poll: Corrupted packet received, stat = %X\n",
191
-		               rxd[cur_rx].stat);
192
-		retstat = 0;
193
-	} else {
194
-		/* give packet to higher routine */
195
-		memcpy(nic->packet, (rxb + cur_rx*DMA_BUF_SIZE), nic->packetlen);
196
-		retstat = 1;
197
-	}
198
-
199
-#ifdef DEBUG_NIC
200
-	printf("p2001_eth_poll: packet from %! to %! received\n", 
201
-		(rxb+cur_rx*DMA_BUF_SIZE)+ETH_ALEN,
202
-		(rxb+cur_rx*DMA_BUF_SIZE));
203
-#endif
204
-
205
-	/* disable receiver */
206
-	// FIXME: is that ok? it can produce grave errors.
207
-	EU->RMAC_DMA_EN = 0;				/* clear run bit */
208
-
209
-	/* return the descriptor and buffer to receive ring */
210
-	rxd[cur_rx].stat = (1<<31) | (1<<30) | (1<<29);	// DSC0 OWN|START|END
211
-	rxd[cur_rx].cntl = (1<<23);			// DSC1 RECEIVE
212
-	rxd[cur_rx].cntl |= cur_channel << 16;		// DSC1 CHANNEL
213
-	rxd[cur_rx].cntl |= DMA_BUF_SIZE;		// DSC1 LEN
214
-
215
-	if (++cur_rx == NUM_RX_DESC)
216
-        	cur_rx = 0;
217
-
218
-	/* enable receiver */
219
-	if (!(EU->RMAC_DMA_EN & 0x01))
220
-		EU->RMAC_DMA_EN = 0x01;			/* set run bit */
221
-
222
-#ifdef DEBUG_NIC
223
-	printf("RMAC_MIB0..5: %d:%d:%d:%d:%d:%d\n",
224
-		EU->RMAC_MIB0, EU->RMAC_MIB1,
225
-		EU->RMAC_MIB2, EU->RMAC_MIB3,
226
-		EU->RMAC_MIB4, EU->RMAC_MIB5);
227
-#endif
228
-
229
-	return retstat;	/* initially as this is called to flush the input */
230
-}
231
-
232
-
233
-
234
-/**************************************************************************
235
- * TRANSMIT - Transmit a frame
236
- **************************************************************************/
237
-
238
-/* Function: p2001_eth_transmit
239
- *
240
- * Description: transmits a packet and waits for completion or timeout.
241
- *
242
- * Arguments: char d[6]:          destination ethernet address.
243
- *            unsigned short t:   ethernet protocol type.
244
- *            unsigned short s:   size of the data-part of the packet.
245
- *            char *p:            the data for the packet.
246
- *    
247
- * Returns:   void.
248
- */
249
-static void p2001_eth_transmit(
250
-	struct nic *nic __unused,
251
-	const char *d,			/* Destination */
252
-	unsigned int t,			/* Type */
253
-	unsigned int s,			/* size */
254
-	const char *p)			/* Packet */
255
-{
256
-	unsigned int nstype;
257
-#ifdef DEBUG_NIC
258
-	unsigned int status;
259
-#endif
260
-
261
-	/* assemble packet */
262
-	memcpy(txb, d, ETH_ALEN);			// destination
263
-	memcpy(txb+ETH_ALEN, nic->node_addr, ETH_ALEN);	// source
264
-	nstype = htons(t);
265
-	memcpy(txb+2*ETH_ALEN, (char*)&nstype, 2);	// type
266
-	memcpy(txb+ETH_HLEN, p, s);			// packet
267
-	s += ETH_HLEN;
268
-
269
-	/* pad to minimum packet size */
270
-//	while (s<ETH_ZLEN)
271
-//		txb[s++] = '\0';
272
-	// TMAC_CNTL.ATP does the same
273
-
274
-#ifdef DEBUG_NIC
275
-	printf("p2001_eth_transmit: packet from %! to %! sent (size: %d)\n", txb+ETH_ALEN, txb, s);
276
-#endif
277
-
278
-	/* configure descriptor */
279
-	txd.stat = (1<<31) | (1<<30) | (1<<29);	// DSC0 OWN|START|END
280
-	txd.cntl = cur_channel << 16;		// DSC1 CHANNEL
281
-	txd.cntl |= s;				// DSC1 LEN
282
-
283
-	/* restart the transmitter */
284
-	EU->TMAC_DMA_EN = 0x01;		/* set run bit */
285
-	while(EU->TMAC_DMA_EN & 0x01);	/* wait */
286
-
287
-#ifdef DEBUG_NIC
288
-	/* check status */
289
-	status = EU->TMAC_DMA_STAT;
290
-	if (status & ~(0x40))	// not END
291
-		printf("p2001_eth_transmit: dma status=0x%hx\n", status);
292
-
293
-	printf("TMAC_MIB6..7: %d:%d\n", EU->TMAC_MIB6, EU->TMAC_MIB7);
294
-#endif
295
-}
296
-
297
-
298
-
299
-/**************************************************************************
300
- * IRQ - Enable, Disable or Force Interrupts
301
- **************************************************************************/
302
-
303
-/* Function: p2001_eth_irq
304
- *
305
- * Description: Enable, Disable, or Force, interrupts
306
- *    
307
- * Arguments: struct nic *nic:          NIC data structure
308
- *            irq_action_t action:      Requested action       
309
- *
310
- * Returns:   void.
311
- */
312
-
313
-static void
314
-p2001_eth_irq(struct nic *nic __unused, irq_action_t action __unused)
315
-{
316
-	switch ( action ) {
317
-		case DISABLE :
318
-			break;
319
-		case ENABLE :
320
-			break;
321
-		case FORCE :
322
-			break;
323
-	}
324
-}
325
-
326
-
327
-
328
-/**************************************************************************
329
- * INIT - Initialize device
330
- **************************************************************************/
331
-
332
-/* Function: p2001_init
333
- *
334
- * Description: resets the ethernet controller chip and various
335
- *    data structures required for sending and receiving packets.
336
- *    
337
- * returns:   void.
338
- */
339
-static void p2001_eth_init()
340
-{
341
-	static int i;
342
-
343
-	/* activate MII 3 */
344
-	if (cur_channel == 3)
345
-		P2001_GPIO->PIN_MUX |= (1<<8);	// MII_3_en = 1
346
-
347
-#ifdef RMII
348
-	/* RMII init sequence */
349
-	if (link & LPA_100) {
350
-		EU->CONF_RMII = (1<<2) | (1<<1);		// softres | 100Mbit
351
-		EU->CONF_RMII = (1<<2) | (1<<1) | (1<<0);	// softres | 100Mbit | RMII
352
-		EU->CONF_RMII = (1<<1) | (1<<0);		// 100 Mbit | RMII
353
-	} else {
354
-		EU->CONF_RMII = (1<<2);				// softres
355
-		EU->CONF_RMII = (1<<2) | (1<<0);		// softres | RMII
356
-		EU->CONF_RMII = (1<<0);				// RMII
357
-	}
358
-#endif
359
-
360
-	/* disable transceiver */
361
-//	EU->TMAC_DMA_EN = 0;		/* clear run bit */
362
-//	EU->RMAC_DMA_EN = 0;		/* clear run bit */
363
-
364
-	/* set rx filter (physical mac addresses) */
365
-	EU->RMAC_PHYU =
366
-		(MAC_HW_ADDR[0]<< 8) +
367
-		(MAC_HW_ADDR[1]<< 0);
368
-	EU->RMAC_PHYL =
369
-		(MAC_HW_ADDR[2]<<24) +
370
-		(MAC_HW_ADDR[3]<<16) +
371
-		(MAC_HW_ADDR[4]<<8 ) +
372
-		(MAC_HW_ADDR[5]<<0 );
373
-
374
-	/* initialize the tx descriptor ring */
375
-//	txd.stat = (1<<31) | (1<<30) | (1<<29);			// DSC0 OWN|START|END
376
-//	txd.cntl = cur_channel << 16;				// DSC1 CHANNEL
377
-//	txd.cntl |= DMA_BUF_SIZE;				// DSC1 LEN
378
-	txd.buf = (char *)&txb;					// DSC2 BUFFER
379
-	txd.next = &txd;					// DSC3 NEXTDSC @self
380
-	EU->TMAC_DMA_DESC = &txd;
381
-
382
-	/* initialize the rx descriptor ring */
383
-	cur_rx = 0;
384
-	for (i = 0; i < NUM_RX_DESC; i++) {
385
-		rxd[i].stat = (1<<31) | (1<<30) | (1<<29);	// DSC0 OWN|START|END
386
-		rxd[i].cntl = (1<<23);				// DSC1 RECEIVE
387
-		rxd[i].cntl |= cur_channel << 16;		// DSC1 CHANNEL
388
-		rxd[i].cntl |= DMA_BUF_SIZE;			// DSC1 LEN
389
-		rxd[i].buf = &rxb[i*DMA_BUF_SIZE];		// DSC2 BUFFER (EU-RX data)
390
-		rxd[i].next = &rxd[i+1];			// DSC3 NEXTDSC @next
391
-	}
392
-	rxd[NUM_RX_DESC-1].next = &rxd[0];			// DSC3 NEXTDSC @first
393
-	EU->RMAC_DMA_DESC = &rxd[0];
394
-
395
-	/* set transmitter mode */
396
-	if (link & LPA_DUPLEX)
397
-		EU->TMAC_CNTL =	(1<<4) |	/* COI: Collision ignore */
398
-				(1<<3) |	/* CSI: Carrier Sense ignore */
399
-				(1<<2);		/* ATP: Automatic Transmit Padding */
400
-	else
401
-		EU->TMAC_CNTL =	(1<<2);		/* ATP: Automatic Transmit Padding */
402
-
403
-	/* set receive mode */
404
-	EU->RMAC_CNTL = (1<<3) |	/* BROAD: Broadcast packets */
405
-			(1<<1);		/* PHY  : Packets to out MAC address */
406
-
407
-	/* enable receiver */
408
-	EU->RMAC_DMA_EN = 1;		/* set run bit */
409
-}
410
-
411
-
412
-
413
-/**************************************************************************
414
- * DISABLE - Turn off ethernet interface
415
- **************************************************************************/
416
-static void p2001_eth_disable(struct dev *dev __unused)
417
-{
418
-	/* put the card in its initial state */
419
-	/* This function serves 3 purposes.
420
-	 * This disables DMA and interrupts so we don't receive
421
-	 *  unexpected packets or interrupts from the card after
422
-	 *  etherboot has finished. 
423
-	 * This frees resources so etherboot may use
424
-	 *  this driver on another interface
425
-	 * This allows etherboot to reinitialize the interface
426
-	 *  if something is something goes wrong.
427
-	 */
428
-
429
-	/* disable transmitter */
430
-	EU->TMAC_DMA_EN = 0;		/* clear run bit */
431
-
432
-	/* disable receiver */
433
-	EU->RMAC_DMA_EN = 0;		/* clear run bit */
434
-}
435
-
436
-
437
-
438
-/**************************************************************************
439
- * LINK - Check for valid link
440
- **************************************************************************/
441
-static int p2001_eth_check_link(unsigned int phy)
442
-{
443
-	static int status;
444
-	static unsigned int i, physid;
445
-
446
-	/* print some information about out PHY */
447
-	physid = (p2001_eth_mdio_read(phy, MII_PHYSID2) << 16) |
448
-		  p2001_eth_mdio_read(phy, MII_PHYSID1);
449
-	printf("PHY %d, ID 0x%x ", phy, physid);
450
-	for (i = 0; mii_chip_table[i].physid; i++)
451
-		if (mii_chip_table[i].physid == physid) {
452
-			printf("(%s).\n", mii_chip_table[i].name);
453
-			break;
454
-		}
455
-	if (!mii_chip_table[i].physid)
456
-		printf("(unknown).\n");
457
-
458
-	/* Use 0x3300 for restarting NWay */
459
-	printf("Starting auto-negotiation... ");
460
-	p2001_eth_mdio_write(phy, MII_BMCR, 0x3300);
461
-
462
-	/* Bit 1.5 is set once the Auto-Negotiation process is completed. */
463
-	i = 0;
464
-	do {
465
-		mdelay(500);
466
-		status = p2001_eth_mdio_read(phy, MII_BMSR);
467
-		if (!status || (i++ > 6))	// 6*500ms = 3s timeout
468
-			goto failed;
469
-	} while (!(status & BMSR_ANEGCOMPLETE));
470
-
471
-	/* Bits 1.2 is set once the link is established. */
472
-	if ((status = p2001_eth_mdio_read(phy, MII_BMSR)) & BMSR_LSTATUS) {
473
-		link = p2001_eth_mdio_read(phy, MII_ADVERTISE) &
474
-		       p2001_eth_mdio_read(phy, MII_LPA);
475
-		printf("  Valid link, operating at: %sMb-%s\n",
476
-			(link & LPA_100) ? "100" : "10",
477
-			(link & LPA_DUPLEX) ? "FD" : "HD");
478
-		return 1;
479
-	}
480
-
481
-failed:
482
-	if (!status)
483
-		printf("Failed\n");
484
-	else
485
-		printf("No valid link\n");
486
-	return 0;
487
-}
488
-
489
-
490
-
491
-/**************************************************************************
492
- * PHYRESET - hardware reset all MII PHYs
493
- **************************************************************************/
494
-
495
-/**
496
- *	p2001_eth_phyreset - hardware reset all MII PHYs
497
- */
498
-static void p2001_eth_phyreset()
499
-{
500
-	/* GPIO24/25: TX_ER2/TX_ER0 */
501
-	/* GPIO26/27: PHY_RESET/TX_ER1 */
502
-	P2001_GPIO->PIN_MUX |= 0x0018;
503
-	// 31-16: 0000 1111 0000 0000
504
-	P2001_GPIO->GPIO2_En |= 0x0400;
505
-
506
-	P2001_GPIO->GPIO2_Out |= 0x04000000;
507
-	P2001_GPIO->GPIO2_Out &= ~0x0400;
508
-	mdelay(500);
509
-	P2001_GPIO->GPIO2_Out |= 0x0400;
510
-
511
-#ifdef RMII
512
-	/* RMII_clk_sel = 0xxb  no RMII (default) */
513
-	/* RMII_clk_sel = 100b	COL_0 */
514
-	/* RMII_clk_sel = 101b	COL_1 */
515
-	/* RMII_clk_sel = 110b	COL_2 */
516
-	/* RMII_clk_sel = 111b	COL_3 */
517
-	P2001_GPIO->PIN_MUX |= (4 << 13);
518
-#endif
519
-}
520
-
521
-
522
-
523
-/**************************************************************************
524
- * PROBE - Look for an adapter, this routine's visible to the outside
525
- **************************************************************************/
526
-
527
-static int p2001_eth_probe(struct dev *dev, unsigned short *probe_addrs __unused)
528
-{
529
-	struct nic *nic = (struct nic *)dev;
530
-	/* if probe_addrs is 0, then routine can use a hardwired default */
531
-
532
-	/* reset phys and configure mdio clk */
533
-	printf("Resetting PHYs...\n");
534
-	p2001_eth_phyreset();
535
-
536
-	/* set management unit clock divisor */
537
-	// max. MDIO CLK = 2.048 MHz (EU.doc)
538
-	P2001_MU->MU_DIV = (SYSCLK/4096000)-1;	// 2.048 MHz
539
-	//asm("nop \n nop");
540
-
541
-	/* find the correct PHY/DMA/MAC combination */
542
-	printf("Searching for P2001 NICs...\n");
543
-	cur_phy = -1;
544
-	for (cur_channel=0; cur_channel<4; cur_channel++) {
545
-		EU = P2001_EU(cur_channel);
546
-
547
-		/* find next phy */
548
-		while (++cur_phy < 16) {
549
-			//printf("phy detect %d\n", cur_phy);
550
-			if (p2001_eth_mdio_read(cur_phy, MII_BMSR) != 0)
551
-				break;
552
-		}
553
-		if (cur_phy == 16) {
554
-			printf("no more MII PHYs found\n");
555
-			break;
556
-		}
557
-
558
-		/* first a non destructive test for initial value RMAC_TLEN=1518 */
559
-		if (EU->RMAC_TLEN == 1518) {
560
-			printf("Checking EU%d...\n", cur_channel);
561
-
562
-			if (p2001_eth_check_link(cur_phy)) {
563
-				/* initialize device */
564
-				p2001_eth_init(nic);
565
-
566
-				/* set node address */
567
-				printf("Setting MAC address to %!\n", MAC_HW_ADDR);
568
-				memcpy(nic->node_addr, MAC_HW_ADDR, 6);
569
-
570
-				/* point to NIC specific routines */
571
-				dev->disable  = p2001_eth_disable;
572
-				nic->poll     = p2001_eth_poll;
573
-				nic->transmit = p2001_eth_transmit;
574
-				nic->irq      = p2001_eth_irq;
575
-
576
-				/* Report the ISA pnp id of the board */
577
-				dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
578
-				return 1;
579
-			}
580
-		}
581
-	}
582
-	/* else */
583
-	return 0;
584
-}
585
-
586
-ISA_ROM("p2001_eth", "P2001 Ethernet Driver")
587
-static struct isa_driver p2001_eth_driver __isa_driver = {
588
-	.type    = NIC_DRIVER,
589
-	.name    = "P2001 Ethernet Driver",
590
-	.probe   = p2001_eth_probe,
591
-	.ioaddrs = 0,
592
-};

+ 0
- 47
src/arch/armnommu/include/bits/byteswap.h View File

@@ -1,47 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_BITS_BYTESWAP_H
9
-#define ETHERBOOT_BITS_BYTESWAP_H
10
-
11
-/* We do not have byte swap functions ... We are
12
- * RISC processor ...
13
- */
14
-
15
-static inline unsigned short __swap16(volatile unsigned short v)
16
-{
17
-    return ((v << 8) | (v >> 8));
18
-}
19
-
20
-static inline unsigned int __swap32(volatile unsigned long v)
21
-{
22
-    return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
23
-}
24
-
25
-#define __bswap_constant_16(x) \
26
-	((uint16_t)((((uint16_t)(x) & 0x00ff) << 8) | \
27
-		(((uint16_t)(x) & 0xff00) >> 8)))
28
-
29
-#define __bswap_constant_32(x) \
30
-	((uint32_t)((((uint32_t)(x) & 0x000000ffU) << 24) | \
31
-		(((uint32_t)(x) & 0x0000ff00U) <<  8) | \
32
-		(((uint32_t)(x) & 0x00ff0000U) >>  8) | \
33
-		(((uint32_t)(x) & 0xff000000U) >> 24)))
34
-
35
-# define __bswap_16(x) \
36
-    (__extension__							      \
37
-     ({ unsigned short int __bsx = (x);					      \
38
-        ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); }))
39
-
40
-
41
-# define __bswap_32(x) \
42
-    (__extension__							      \
43
-     ({ unsigned int __bsx = (x);					      \
44
-        ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >>  8) |    \
45
-	 (((__bsx) & 0x0000ff00) <<  8) | (((__bsx) & 0x000000ff) << 24)); }))
46
-
47
-#endif /* ETHERBOOT_BITS_BYTESWAP_H */

+ 0
- 13
src/arch/armnommu/include/bits/cpu.h View File

@@ -1,13 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ARM_BITS_CPU_H
9
-#define ARM_BITS_CPU_H
10
-
11
-#define cpu_setup() do {} while(0)
12
-
13
-#endif /* ARM_BITS_CPU_H */

+ 0
- 18
src/arch/armnommu/include/bits/elf.h View File

@@ -1,18 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ARM_BITS_ELF_H
9
-#define ARM_BITS_ELF_H
10
-
11
-/* ELF Defines for the current architecture */
12
-#define	EM_CURRENT	EM_ARM
13
-#define ELFDATA_CURRENT	ELFDATA2LSB
14
-
15
-#define ELF_CHECK_ARCH(x) \
16
-	((x).e_machine == EM_CURRENT)
17
-
18
-#endif /* ARM_BITS_ELF_H */

+ 0
- 17
src/arch/armnommu/include/bits/endian.h View File

@@ -1,17 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_BITS_ENDIAN_H
9
-#define ETHERBOOT_BITS_ENDIAN_H
10
-
11
-#ifdef __ARMEB__
12
-#define __BYTE_ORDER __BIG_ENDIAN
13
-#else
14
-#define __BYTE_ORDER __LITTLE_ENDIAN
15
-#endif
16
-
17
-#endif /* ETHERBOOT_BITS_ENDIAN_H */

+ 0
- 11
src/arch/armnommu/include/bits/string.h View File

@@ -1,11 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_BITS_STRING_H
9
-#define ETHERBOOT_BITS_STRING_H
10
-
11
-#endif /* ETHERBOOT_BITS_STRING_H */

+ 0
- 1
src/arch/armnommu/include/callbacks_arch.h View File

@@ -1 +0,0 @@
1
-/* empty file */

+ 0
- 170
src/arch/armnommu/include/hardware.h View File

@@ -1,170 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-
9
-/*
10
- * Architecture: ARM9TDMI
11
- * Processor   : P2001
12
- */
13
-
14
-#ifndef ARCH_HARDWARE_H
15
-#define ARCH_HARDWARE_H
16
-
17
-#ifndef __ASSEMBLY__
18
-
19
-/* DMA descriptor */
20
-typedef struct {
21
-	unsigned int stat;			/* status: own, start, end, offset, status */
22
-	unsigned int cntl;			/* control: loop, int, type, channel, length */
23
-	char	*buf;				/* buffer */
24
-	void	*next;				/* nextdsc */
25
-} DMA_DSC;
26
-
27
-
28
-/* The address definitions are from asic_bf.h */
29
-typedef struct {					// 0x00100000U
30
-	volatile unsigned int reserved1[0x3];
31
-	volatile unsigned int ArmDmaPri;		// 0x0000000CU
32
-	volatile unsigned int SDRAM_Ctrl;		// 0x00000010U
33
-	volatile unsigned int ExtMem_Ctrl;		// 0x00000014U
34
-	volatile unsigned int WaitState_Ext;		// 0x00000018U
35
-	volatile unsigned int WaitState_Asic;		// 0x0000001CU
36
-	volatile unsigned int TOP;			// 0x00000020U
37
-	volatile unsigned int reserved2[0x3];
38
-	volatile unsigned int Adr1_EQ_30Bit;		// 0x00000030U
39
-	volatile unsigned int Adr2_EQ_30Bit;		// 0x00000034U
40
-	volatile unsigned int Adr3_EQ_30Bit;		// 0x00000038U
41
-	volatile unsigned int Dat3_EQ_32Bit;		// 0x0000003CU
42
-	volatile unsigned int Adr4_HE_20Bit;		// 0x00000040U
43
-	volatile unsigned int Adr4_LT_20Bit;		// 0x00000044U
44
-	volatile unsigned int Adr5_HE_20Bit;		// 0x00000048U
45
-	volatile unsigned int Adr5_LT_20Bit;		// 0x0000004CU
46
-	volatile unsigned int Adr_Control;		// 0x00000050U
47
-	volatile unsigned int ABORT_IA_32Bit;		// 0x00000054U
48
-} *P2001_SYS_regs_ptr;
49
-#define P2001_SYS ((volatile P2001_SYS_regs_ptr) 0x00100000)
50
-
51
-typedef struct {					// 0x00110000U
52
-	volatile unsigned int Timer1;			// 0x00000000U
53
-	volatile unsigned int Timer2;			// 0x00000004U
54
-	volatile unsigned int TIMER_PRELOAD;		// 0x00000008U
55
-	volatile unsigned int Timer12_PreDiv;		// 0x0000000CU
56
-	volatile unsigned int TIMER_INT;		// 0x00000010U
57
-	volatile unsigned int Freerun_Timer;		// 0x00000014U
58
-	volatile unsigned int WatchDog_Timer;		// 0x00000018U
59
-	volatile unsigned int PWM_CNT;			// 0x00000020U
60
-	volatile unsigned int PWM_CNT2;			// 0x00000024U
61
-	volatile unsigned int PLL_12000_config;		// 0x00000030U
62
-	volatile unsigned int PLL_12288_config;		// 0x00000034U
63
-	volatile unsigned int DIV_12288_config;		// 0x00000038U
64
-	volatile unsigned int MOD_CNT_768;		// 0x0000003CU
65
-	volatile unsigned int FSC_IRQ_STATUS;		// 0x00000040U
66
-	volatile unsigned int FSC_CONFIG;		// 0x00000044U
67
-	volatile unsigned int FSC_CONSTRUCT;		// 0x00000048U
68
-	volatile unsigned int FSC_base_clk_reg;		// 0x0000004CU
69
-	volatile unsigned int SYSCLK_SHAPE;		// 0x00000050U
70
-	volatile unsigned int SDRAMCLK_SHAPE;		// 0x00000054U
71
-	volatile unsigned int RING_OSZI;		// 0x00000058U
72
-} *P2001_TIMER_regs_ptr;
73
-#define P2001_TIMER ((volatile P2001_TIMER_regs_ptr) 0x00110000)
74
-
75
-typedef struct {					// 0x00120000U
76
-	volatile unsigned int reserved1[0x5];
77
-	volatile unsigned int GPIO_Config;		// 0x00000014U
78
-	volatile unsigned int GPIO_INT;			// 0x00000018U
79
-	volatile unsigned int GPIO_Out;			// 0x0000001CU
80
-	volatile unsigned int GPIO_IN;			// 0x00000020U
81
-	volatile unsigned int GPIO_En;			// 0x00000024U
82
-	volatile unsigned int PIN_MUX;			// 0x00000028U
83
-	volatile unsigned int NRES_OUT;			// 0x0000002CU
84
-	volatile unsigned int GPIO2_Out;		// 0x00000030U
85
-	volatile unsigned int GPIO2_IN;			// 0x00000034U
86
-	volatile unsigned int GPIO2_En;			// 0x00000038U
87
-	volatile unsigned int GPIO_INT_SEL;		// 0x0000003CU
88
-	volatile unsigned int GPI3_IN;			// 0x00000040U
89
-	volatile unsigned int GPO4_OUT;			// 0x00000044U
90
-} *P2001_GPIO_regs_ptr;
91
-#define P2001_GPIO ((volatile P2001_GPIO_regs_ptr) 0x00120000)
92
-
93
-typedef struct {					// 0x00130000U
94
-	volatile unsigned int Main_NFIQ_Int_Ctrl;	// 0x00000000U
95
-	volatile unsigned int Main_NIRQ_Int_Ctrl;	// 0x00000004U
96
-	volatile unsigned int Status_NFIQ;		// 0x00000008U
97
-	volatile unsigned int Status_NIRQ;		// 0x0000000CU
98
-} *P2001_INT_CTRL_regs_ptr;
99
-#define P2001_INT_CTRL ((volatile P2001_INT_CTRL_regs_ptr) 0x00130000)
100
-
101
-typedef union {						// 0x00140000U
102
-	struct {	// write
103
-		volatile unsigned int TX[4];		// 0x00000000-0x000CU
104
-		volatile unsigned int Baudrate;		// 0x00000010U
105
-		volatile unsigned int reserved1[0x3];
106
-		volatile unsigned int Config;		// 0x00000020U
107
-		volatile unsigned int Clear;		// 0x00000024U
108
-		volatile unsigned int Echo_EN;		// 0x00000028U
109
-		volatile unsigned int IRQ_Status;	// 0x0000002CU
110
-	} w;		// write
111
-	
112
-	struct {	// read
113
-		volatile unsigned int RX[4];		// 0x00000000-0x000CU
114
-		volatile unsigned int reserved1[0x4];
115
-		volatile unsigned int PRE_STATUS;	// 0x00000020U
116
-		volatile unsigned int STATUS;		// 0x00000024U
117
-		volatile unsigned int reserved2[0x1];
118
-		volatile unsigned int IRQ_Status;	// 0x0000002CU
119
-	} r;		// read
120
-} *P2001_UART_regs_ptr;
121
-#define P2001_UART ((volatile P2001_UART_regs_ptr) 0x00140000)
122
-
123
-typedef struct {				// 0x0018_000U _=0,1,2,3
124
-	volatile DMA_DSC *    RMAC_DMA_DESC;	// 0x00000000U
125
-	volatile unsigned int RMAC_DMA_CNTL;	// 0x00000004U
126
-	volatile unsigned int RMAC_DMA_STAT;	// 0x00000008U
127
-	volatile unsigned int RMAC_DMA_EN;	// 0x0000000CU
128
-	volatile unsigned int RMAC_CNTL;	// 0x00000010U
129
-	volatile unsigned int RMAC_TLEN;	// 0x00000014U
130
-	volatile unsigned int RMAC_PHYU;	// 0x00000018U
131
-	volatile unsigned int RMAC_PHYL;	// 0x0000001CU
132
-	volatile unsigned int RMAC_PFM0;	// 0x00000020U
133
-	volatile unsigned int RMAC_PFM1;	// 0x00000024U
134
-	volatile unsigned int RMAC_PFM2;	// 0x00000028U
135
-	volatile unsigned int RMAC_PFM3;	// 0x0000002CU
136
-	volatile unsigned int RMAC_PFM4;	// 0x00000030U
137
-	volatile unsigned int RMAC_PFM5;	// 0x00000034U
138
-	volatile unsigned int RMAC_PFM6;	// 0x00000038U
139
-	volatile unsigned int RMAC_PFM7;	// 0x0000003CU
140
-	volatile unsigned int RMAC_MIB0;	// 0x00000040U
141
-	volatile unsigned int RMAC_MIB1;	// 0x00000044U
142
-	volatile unsigned int RMAC_MIB2;	// 0x00000048U
143
-	volatile unsigned int RMAC_MIB3;	// 0x0000004CU
144
-	volatile unsigned int RMAC_MIB4;	// 0x00000050U
145
-	volatile unsigned int RMAC_MIB5;	// 0x00000054U
146
-	volatile unsigned int reserved1[0x1e8];
147
-	volatile unsigned int RMAC_DMA_DATA;	// 0x000007F8U
148
-	volatile unsigned int RMAC_DMA_ADR;	// 0x000007FCU
149
-	volatile DMA_DSC *    TMAC_DMA_DESC;	// 0x00000800U
150
-	volatile unsigned int TMAC_DMA_CNTL;	// 0x00000804U
151
-	volatile unsigned int TMAC_DMA_STAT;	// 0x00000808U
152
-	volatile unsigned int TMAC_DMA_EN;	// 0x0000080CU
153
-	volatile unsigned int TMAC_CNTL;	// 0x00000810U
154
-	volatile unsigned int TMAC_MIB6;	// 0x00000814U
155
-	volatile unsigned int TMAC_MIB7;	// 0x00000818U
156
-	volatile unsigned int reserved2[0x1];
157
-	volatile unsigned int MU_CNTL;		// 0x00000820U
158
-	volatile unsigned int MU_DATA;		// 0x00000824U
159
-	volatile unsigned int MU_DIV;		// 0x00000828U
160
-	volatile unsigned int CONF_RMII;	// 0x0000082CU
161
-	volatile unsigned int reserved3[0x1f2];
162
-	volatile unsigned int TMAC_DMA_DATA;	// 0x00000FF8U
163
-	volatile unsigned int TMAC_DMA_ADR;	// 0x00000FFCU
164
-} *P2001_ETH_regs_ptr;
165
-#define P2001_EU(x) ((volatile P2001_ETH_regs_ptr) ((unsigned int) 0x00180000UL+(0x1000UL*(x)))) /* x = 0..3 */
166
-#define P2001_MU  P2001_EU(0)
167
-
168
-#endif
169
-
170
-#endif  /* ARCH_HARDWARE_H */

+ 0
- 25
src/arch/armnommu/include/hooks.h View File

@@ -1,25 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_ARM_HOOKS_H
9
-#define ETHERBOOT_ARM_HOOKS_H
10
-
11
-struct Elf_Bhdr;
12
-
13
-#define arch_main(data, params) do {} while(0)
14
-//void arch_main(in_call_data_t *data, va_list params);
15
-
16
-#define arch_on_exit(status) do {} while(0)
17
-//void arch_on_exit(int status);
18
-
19
-#define arch_relocate_to(addr) do {} while(0)
20
-//void arch_relocate_to(unsigned long addr);
21
-
22
-#define arch_relocated_from(old_addr) do {} while(0)
23
-//void arch_relocate_from(unsigned long old_addr);
24
-
25
-#endif /* ETHERBOOT_ARM_HOOKS_H */

+ 0
- 27
src/arch/armnommu/include/io.h View File

@@ -1,27 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_IO_H
9
-#define ETHERBOOT_IO_H
10
-
11
-#define virt_to_phys(vaddr)	((unsigned long) (vaddr))
12
-#define phys_to_virt(vaddr)	((void *) (vaddr))
13
-
14
-#define virt_to_bus virt_to_phys
15
-#define bus_to_virt phys_to_virt
16
-
17
-#define iounmap(addr)				((void)0)
18
-#define ioremap(physaddr, size)			(physaddr)
19
-
20
-extern unsigned char inb (unsigned long int port);
21
-extern unsigned short int inw (unsigned long int port);
22
-extern unsigned long int inl (unsigned long int port);
23
-extern void outb (unsigned char value, unsigned long int port);
24
-extern void outw (unsigned short value, unsigned long int port);
25
-extern void outl (unsigned long value, unsigned long int port);
26
-
27
-#endif /* ETHERBOOT_IO_H */

+ 0
- 15
src/arch/armnommu/include/latch.h View File

@@ -1,15 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef LATCH_H
9
-#define LATCH_H
10
-
11
-// Freerun_Timer is always at 12.288 MHZ
12
-#define TICKS_PER_SEC		(12288000UL)
13
-//#define TICKS_PER_SEC		(73728000UL)
14
-
15
-#endif /* LATCH_H */

+ 0
- 43
src/arch/armnommu/include/limits.h View File

@@ -1,43 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef __LIMITS_H
9
-#define __LIMITS_H  1
10
-
11
-#define MB_LEN_MAX	16
12
-
13
-#define CHAR_BIT	8
14
-
15
-#define SCHAR_MIN	(-128)
16
-#define SCHAR_MAX	127
17
-
18
-#define UCHAR_MAX	255
19
-
20
-#define CHAR_MIN	SCHAR_MIN
21
-#define CHAR_MAX	SCHAR_MAX
22
-
23
-#define SHRT_MIN	(-32768)
24
-#define SHRT_MAX	32767
25
-
26
-#define USHRT_MAX	65535
27
-
28
-#define INT_MIN	(-INT_MAX - 1)
29
-#define INT_MAX	2147483647
30
-
31
-#define UINT_MAX	4294967295U
32
-
33
-#define LONG_MAX	2147483647L
34
-#define LONG_MIN	(-LONG_MAX - 1L)
35
-
36
-#define ULONG_MAX	4294967295UL
37
-
38
-#define LLONG_MAX	9223372036854775807LL
39
-#define LLONG_MIN	(-LLONG_MAX - 1LL)
40
-
41
-#define ULLONG_MAX	18446744073709551615ULL
42
-
43
-#endif

+ 0
- 23
src/arch/armnommu/include/setjmp.h View File

@@ -1,23 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef ETHERBOOT_SETJMP_H
9
-#define ETHERBOOT_SETJMP_H
10
-
11
-#ifndef __ASSEMBLER__
12
-/* Jump buffer contains v1-v6, sl, fp, sp and pc.  Other registers are not
13
-   saved.  */
14
-//typedef int jmp_buf[22];
15
-typedef int jmp_buf[10];
16
-#endif
17
-
18
-extern int sigsetjmp(jmp_buf __env, int __savemask);
19
-extern void longjmp(jmp_buf __env, int __val) __attribute__((__noreturn__));
20
-
21
-#define setjmp(env) sigsetjmp(env,0)
22
-
23
-#endif /* ETHERBOOT_SETJMP_H */

+ 0
- 35
src/arch/armnommu/include/stdint.h View File

@@ -1,35 +0,0 @@
1
-/*
2
- *  Copyright (C) 2004 Tobias Lorenz
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- */
8
-#ifndef STDINT_H
9
-#define STDINT_H
10
-
11
-typedef unsigned long      size_t;
12
-
13
-typedef unsigned char      uint8_t;
14
-typedef unsigned short     uint16_t;
15
-typedef unsigned long      uint32_t;
16
-typedef unsigned long long uint64_t;
17
-
18
-typedef signed char        int8_t;
19
-typedef signed short       int16_t;
20
-typedef signed int         int32_t;
21
-typedef signed long long   int64_t;
22
-
23
-typedef signed char        s8;
24
-typedef unsigned char      u8;
25
-
26
-typedef signed short       s16;
27
-typedef unsigned short     u16;
28
-
29
-typedef signed long        s32;
30
-typedef unsigned int       u32;
31
-
32
-typedef signed long long   s64;
33
-typedef unsigned long long u64;
34
-
35
-#endif /* STDINT_H */

+ 0
- 7
src/arch/e1/Config View File

@@ -1,7 +0,0 @@
1
-# Config for e1 Etherboot
2
-#
3
-
4
-CFLAGS+= -mgnu-param -DCONSOLE_SERIAL -DCOMCONSOLE=0x01C00000 -DCONSPEED=28800 
5
-CFLAGS+= -DSIZEINDICATOR  -DNO_DHCP_SUPPORT -DBAR_PROGRESS
6
-#CFLAGS+= -DEMBEDDED -DMAC_HW_ADDR_DRV="'H','Y','L','N','X','1'"
7
-

+ 0
- 70
src/arch/e1/Makefile View File

@@ -1,70 +0,0 @@
1
-ARCH_FORMAT=	coff-e1
2
-
3
-BUILD_ROMS=	$(ROMS)
4
-BUILD_COFFS=	$(patsubst %img, %coff, $(IMGS))
5
-SUFFIXES+=	rom zrom coff
6
-
7
-CC=		e1-coff-gcc
8
-AS=		e1-coff-as
9
-LD=		e1-coff-ld
10
-SIZE=	e1-coff-size
11
-AR=		e1-coff-ar
12
-RANLIB=	e1-coff-ranlib
13
-OBJCOPY=e1-coff-objcopy
14
-
15
-# DMAC_HW_ADDR_DRV holds the ethernet's MAC address. It is passed as
16
-# flag to the low level driver instead of reading it from an 
17
-# external EEPROM, which we do not have!
18
-EXTRA_CFLAGS = -DEMBEDDED -DMAC_HW_ADDR_DRV="'H','Y','L','N','X','1'"
19
-
20
-START=	$(BIN)/start.o
21
-START16=	$(BIN)/start.o
22
-
23
-SRCS+=	arch/e1/core/e132_xs.c
24
-SRCS+=	arch/e1/core/e1_timer.c
25
-SRCS+=	arch/e1/core/longjmp.c
26
-SRCS+=	arch/e1/core/memcmp.S
27
-SRCS+=	arch/e1/core/memcpy.S
28
-SRCS+=	arch/e1/core/memset.S
29
-SRCS+=	arch/e1/core/setjmp.c
30
-SRCS+=	arch/e1/core/strcmp.S
31
-SRCS+=	arch/e1/core/start.S
32
-
33
-ROMLIMIT:=3276800
34
-
35
-include		$(BIN)/Roms
36
-
37
-ROMS= $(BIN)/cs89x0.rom
38
-IMGS= $(BIN)/cs89x0.img
39
-
40
-#allfiles:	$(BUILD_ROMS)
41
-all:	$(BUILD_COFFS)
42
-
43
-BOBJS+=		$(BIN)/e1_timer.o
44
-BOBJS+=		$(BIN)/memcmp.o $(BIN)/memcpy.o $(BIN)/memset.o
45
-BOBJS+=		$(BIN)/setjmp.o $(BIN)/longjmp.o 
46
-BOBJS+=		$(BIN)/e132_xs.o
47
-
48
-# Utilities
49
-
50
-$(BIN)/nrv2b:	util/nrv2b.c
51
-	$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
52
-
53
-# Pattern Rules
54
-# General for compiling/assembly source files
55
-$(BIN)/cs89x0.o:	drivers/net/cs89x0.c $(MAKEDEPS)
56
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
57
-# With the current tools we have problem with the compilation 
58
-# of the vsprintf file when the -O2 is selected. So we compile 
59
-# the aforemntioned file with -O1 !!!
60
-$(BIN)/vsprintf.o:	core/vsprintf.c $(MAKEDEPS)
61
-	$(CC) $(CFLAGS) -O1 -o $@ -c $<
62
-
63
-$(BIN)/%.o:	arch/e1/core/%.c $(MAKEDEPS)
64
-	$(CC) $(CFLAGS) -o $@ -c $<
65
-
66
-$(BIN)/%.o:	arch/e1/core/%.S $(MAKEDEPS)
67
-	$(CPP) $(CFLAGS) -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
68
-
69
-$(BIN)/%.coff:	$(BIN)/%.tmp $(MAKEDEPS)
70
-	mv $< $(BIN)/etherboot.coff

+ 0
- 67
src/arch/e1/Makefile.working View File

@@ -1,67 +0,0 @@
1
-ARCH_FORMAT=	coff-e1
2
-
3
-CC=		e1-coff-gcc
4
-AS=		e1-coff-as
5
-LD=		e1-coff-ld
6
-SIZE=	e1-coff-size
7
-AR=		e1-coff-ar
8
-RANLIB=	e1-coff-ranlib
9
-OBJCOPY=e1-coff-objcopy
10
-
11
-EXTRA_CFLAGS = -DEMBEDDED -DMAC_HW_ADDR_DRV="'H','Y','L','N','X','1'"
12
-
13
-BUILD_ROMS=	$(ROMS)
14
-BUILD_COFFS=	$(BIN)/cs89x0.coff
15
-#BUILD_COFFS=	$(patsubst %img, %coff, $(IMGS))
16
-
17
-START=	$(BIN)/start.o
18
-START16=	$(BIN)/start.o
19
-
20
-#SRCS+=	arch/e1/core/coff_loader.c
21
-SRCS+=	arch/e1/core/e132_xs.c
22
-SRCS+=	arch/e1/core/e1_timer.c
23
-SRCS+=	arch/e1/core/longjmp.c
24
-SRCS+=	arch/e1/core/memcmp.S
25
-SRCS+=	arch/e1/core/memcpy.S
26
-SRCS+=	arch/e1/core/memset.S
27
-SRCS+=	arch/e1/core/setjmp.c
28
-SRCS+=	arch/e1/core/strcmp.S
29
-SRCS+=	arch/e1/core/start.S
30
-
31
-ROMLIMIT:=3276800
32
-
33
-include		$(BIN)/Roms
34
-
35
-hyperstone:		$(BUILD_COFFS)
36
-coff:		$(BUILD_COFFS)
37
-
38
-BOBJS+=		$(BIN)/e1_timer.o
39
-BOBJS+=		$(BIN)/memcmp.o $(BIN)/memcpy.o $(BIN)/memset.o
40
-BOBJS+=		$(BIN)/setjmp.o $(BIN)/longjmp.o 
41
-BOBJS+=		$(BIN)/e132_xs.o
42
-
43
-# Utilities
44
-
45
-$(BIN)/nrv2b:	util/nrv2b.c
46
-	$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
47
-
48
-# Pattern Rules
49
-# General for compiling/assembly source files
50
-
51
-$(BIN)/cs89x0.o:	drivers/net/cs89x0.c $(MAKEDEPS)
52
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
53
-# With the current tools we have problem with the compilation 
54
-# of the vsprintf file when the -O2 is selected. So we compile 
55
-# the aforemntioned file with -O1 !!!
56
-$(BIN)/vsprintf.o:	core/vsprintf.c $(MAKEDEPS)
57
-	$(CC) $(CFLAGS) -O1 -o $@ -c $<
58
-
59
-$(BIN)/%.o:	arch/e1/core/%.c $(MAKEDEPS)
60
-	$(CC) $(CFLAGS) -o $@ -c $<
61
-
62
-$(BIN)/%.o:	arch/e1/core/%.S $(MAKEDEPS)
63
-	$(CPP) $(CFLAGS) -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
64
-
65
-$(BIN)/%.coff:	$(BIN)/%.tmp $(MAKEDEPS)
66
-	mv $< $(BIN)/etherboot.coff
67
-

+ 0
- 80
src/arch/e1/README View File

@@ -1,80 +0,0 @@
1
-Introduction
2
----------------------
3
-This README file provides guideliness to compile successfully the 
4
-Etherboot for Hyperstone.
5
-This directory (src/arch/e1) contains the files that depend on 
6
-Hyperstone's architecture. The header files that include the 
7
-configuration of the system are based on Hyperstone's E132-XS 
8
-development board. The can be very easily modified to support 
9
-anyother configuration environment. 
10
-
11
-Software Perquisites:
12
----------------------
13
-The build environment requires a C compiler for the E1-32XS
14
-processor. Normally you can simply install a cross-compiling tool
15
-chain based on the GNU tools (that is binutils and gcc). If you
16
-are running a Linux system on a x86 CPU then you can just download
17
-the toolchain as a binary from Hyperstone's official web-site. The
18
-binary distribution will untar the tools in the /usr/local/e1-coff
19
-directory. On any other system you will need to build the tool
20
-chain from the sources.
21
-
22
-To compile successfully the following tools should be available:
23
- - GNU toolchain:
24
-    - GCC ver 2.95.2 20030110 (release)         e1-coff-gcc -v
25
-    - LD ver 2.12.90 20020726                   e1-coff-ld -V
26
-
27
-Hardware Perquisites:
28
----------------------
29
-The etherboot has been successfully tested in the E1-32XS
30
-development board. A second serial device is initialized
31
-to act as a console. The standard messages
32
-are redirected to the console. Nevertheless, if one wants not
33
-to use the serial console he may omit the corresponding switches
34
-from the Config file located under "src/arch/e1/" directory.
35
-
36
-On the E1-32XS board that was  used, a daughter-board was employed
37
-to connect a second HyIce to the development board. Since the HyIce
38
-embeds a standard 16550 device, the Etherboot's standard device 
39
-driver is used.
40
-
41
-The position of the jumpers of the development board in order to
42
-initialize both the second HyIce and the Ethernet device is
43
-depicted in the following table:
44
-
45
-Jumper: Position
46
-------:--------------
47
-J3      1-2 (default)
48
-J4      1-2 (default)
49
-J13     5-6
50
-J5      1-2 (default)
51
-J6      1-2 & 3-4
52
-J7      3-4
53
-J9      1-2 (default)
54
-J10     1-2
55
-J11     3-4
56
-
57
-Compilation
58
----------------------
59
-In order to compile Etherboot for Hyperstone, the following steps should be followed:
60
-1) Edit the main Makefile (located under "src" directory") and comment-out
61
-the ARCH variable (by putting a "#" in front of it). Append the following line:
62
-ARCH:=e1
63
-2) Edit the Config file (the one located under "src" directory) and make sure that
64
-the CFLAGS variable will contain *only* the following swithces:
65
-CFLAGS+=	-DCONFIG_ISA
66
-CFLAGS+=	-DBOOT_FIRST=BOOT_NIC
67
-CFLAGS+=	-DALLOW_ONLY_ENCAPSULATED
68
-CFLAGS+=	-DBACKOFF_LIMIT=7 -DCONGESTED
69
-CFLAGS+=	-DCOFF_IMAGE 
70
-CFLAGS+=	-DDOWNLOAD_PROTO_TFTP
71
-Please note that extra or any other switches may cause failure of compilation!
72
-3) type "make hyperstone" or "make coff"
73
-4) the generated file will be located under the "src/bin" directory and will be called :
74
- "etherboot.coff". Now you may download it with usual way using e1-coff-gdb ..
75
-
76
-Have Fun
77
-
78
-Yannis Mitsos, George Thanos
79
-{gmitsos,gthanos}@telecom.ntua.gr
80
-

+ 0
- 176
src/arch/e1/core/coff_loader.c View File

@@ -1,176 +0,0 @@
1
-/*
2
- * Copyright 2003 Yannis Mitsos and George Thanos 
3
- * {gmitsos@gthanos}@telecom.ntua.gr
4
- * Released under GPL2, see the file COPYING in the top directory
5
- * COFF loader is based on the source code of the ELF loader.
6
- *
7
- */
8
-#include "coff.h"
9
-
10
-#define COFF_DEBUG 0
11
-
12
-typedef struct {
13
-	COFF_filehdr coff32;
14
-	COFF_opthdr	opthdr32;
15
-	union {
16
-		COFF_scnhdr scnhdr32[1];
17
-		unsigned char dummy[1024];
18
-	} p;
19
-	unsigned long curaddr;
20
-	signed int segment;		/* current segment number, -1 for none */
21
-	unsigned int loc;		/* start offset of current block */
22
-	unsigned int skip;		/* padding to be skipped to current segment */
23
-	unsigned long toread;	/* remaining data to be read in the segment */
24
-}coff_state;
25
-
26
-coff_state cstate;
27
-
28
-static sector_t coff32_download(unsigned char *data, unsigned int len, int eof);
29
-static inline os_download_t coff_probe(unsigned char *data, unsigned int len)
30
-{
31
-	unsigned long phdr_size;
32
-
33
-	if (len < (sizeof(cstate.coff32)+ sizeof(cstate.opthdr32))) {
34
-		return 0;
35
-	}
36
-	memcpy(&cstate.coff32, data, (sizeof(cstate.coff32)+sizeof(cstate.opthdr32)));
37
-
38
-	if ((cstate.coff32.f_magic != EM_E1) ||
39
-	  	(cstate.opthdr32.magic != O_MAGIC)){
40
-		return 0;
41
-	}
42
-	printf("(COFF");
43
-	printf(")... \n");
44
-
45
-	if (cstate.coff32.f_opthdr == 0){
46
-		printf("No optional header in COFF file, cannot find the entry point\n");
47
-                return dead_download;
48
-	}
49
-
50
-	phdr_size = cstate.coff32.f_nscns * sizeof(cstate.p.scnhdr32);
51
-	if (sizeof(cstate.coff32) +  cstate.coff32.f_opthdr + phdr_size > len) {
52
-		printf("COFF header outside first block\n");
53
-                return dead_download;
54
-	}
55
-
56
-	memcpy(&cstate.p.scnhdr32, data + (sizeof(cstate.coff32) +  cstate.coff32.f_opthdr), phdr_size);
57
-
58
-	/* Check for Etherboot related limitations.  Memory
59
-	 * between _text and _end is not allowed.
60
-	 * Reasons: the Etherboot code/data area.
61
-	 */
62
-	for (cstate.segment = 0; cstate.segment < cstate.coff32.f_nscns; cstate.segment++) {
63
-		unsigned long start, mid, end, istart, iend;
64
-
65
-		if ((cstate.p.scnhdr32[cstate.segment].s_flags != S_TYPE_TEXT) && 
66
-			(cstate.p.scnhdr32[cstate.segment].s_flags != S_TYPE_DATA) && 
67
-			(cstate.p.scnhdr32[cstate.segment].s_flags != S_TYPE_BSS)){ /* Do we realy need to check the BSS section ? */
68
-#ifdef COFF_DEBUG
69
-				printf("Section <%s> in not a loadable section \n",cstate.p.scnhdr32[cstate.segment].s_name);
70
-#endif
71
-			continue;
72
-		}
73
-
74
-	start = cstate.p.scnhdr32[cstate.segment].s_paddr;
75
-	mid = start + cstate.p.scnhdr32[cstate.segment].s_size;
76
-	end = start + cstate.p.scnhdr32[cstate.segment].s_size;
77
-
78
-	/* Do we need the following variables ? */
79
-	istart = 0x8000;
80
-	iend = 0x8000;
81
-
82
-		if (!prep_segment(start, mid, end, istart, iend)) {
83
-                	return dead_download;
84
-		}
85
-}
86
-	cstate.segment = -1;
87
-	cstate.loc = 0;
88
-	cstate.skip = 0;
89
-	cstate.toread = 0;
90
-	return coff32_download;
91
-}
92
-
93
-extern int mach_boot(unsigned long entry_point);
94
-static sector_t coff32_download(unsigned char *data, unsigned int len, int eof)
95
-{
96
-	unsigned long skip_sectors = 0;
97
-	unsigned int offset;	/* working offset in the current data block */
98
-	int i;
99
-
100
-	offset = 0;
101
-	do {
102
-		if (cstate.segment != -1) {
103
-			if (cstate.skip) {
104
-				if (cstate.skip >= len - offset) {
105
-					cstate.skip -= len - offset;
106
-					break;
107
-				}
108
-				offset += cstate.skip;
109
-				cstate.skip = 0;
110
-			}
111
-			
112
-			if (cstate.toread) {
113
-				unsigned int cplen;
114
-				cplen = len - offset;
115
-				if (cplen >= cstate.toread) {
116
-					cplen = cstate.toread;
117
-				}
118
-				memcpy(phys_to_virt(cstate.curaddr), data+offset, cplen);
119
-				cstate.curaddr += cplen;
120
-				cstate.toread -= cplen;
121
-				offset += cplen;
122
-				if (cstate.toread)
123
-					break;
124
-			}
125
-		}
126
-	
127
-		/* Data left, but current segment finished - look for the next
128
-		 * segment (in file offset order) that needs to be loaded. 
129
-		 * We can only seek forward, so select the program headers,
130
-		 * in the correct order.
131
-		 */
132
-		cstate.segment = -1;
133
-		for (i = 0; i < cstate.coff32.f_nscns; i++) {
134
-
135
-			if ((cstate.p.scnhdr32[i].s_flags != S_TYPE_TEXT) && 
136
-			(cstate.p.scnhdr32[i].s_flags != S_TYPE_DATA))
137
-				continue;
138
-			if (cstate.p.scnhdr32[i].s_size == 0)
139
-				continue;
140
-			if (cstate.p.scnhdr32[i].s_scnptr < cstate.loc + offset)
141
-				continue;	/* can't go backwards */
142
-			if ((cstate.segment != -1) &&
143
-				(cstate.p.scnhdr32[i].s_scnptr >= cstate.p.scnhdr32[cstate.segment].s_scnptr))
144
-				continue;	/* search minimum file offset */
145
-			cstate.segment = i;
146
-		}
147
-
148
-		if (cstate.segment == -1) {
149
-			/* No more segments to be loaded, so just start the
150
-			 * kernel.  This saves a lot of network bandwidth if
151
-			 * debug info is in the kernel but not loaded.  */
152
-			goto coff_startkernel;
153
-			break;
154
-		}
155
-		cstate.curaddr = cstate.p.scnhdr32[cstate.segment].s_paddr;
156
-		cstate.skip	   = cstate.p.scnhdr32[cstate.segment].s_scnptr - (cstate.loc + offset);
157
-		cstate.toread  = cstate.p.scnhdr32[cstate.segment].s_size;
158
-#if COFF_DEBUG
159
-		printf("PHDR %d, size %#lX, curaddr %#lX\n",
160
-			cstate.segment, cstate.toread, cstate.curaddr);
161
-#endif
162
-	} while (offset < len);
163
-
164
-	cstate.loc += len + (cstate.skip & ~0x1ff);
165
-	skip_sectors = cstate.skip >> 9;
166
-	cstate.skip &= 0x1ff;
167
-	
168
-	if (eof) {
169
-		unsigned long entry;
170
-coff_startkernel:
171
-		entry = cstate.opthdr32.entry;
172
-		done();
173
-		mach_boot(entry);
174
-	}
175
-	return skip_sectors;
176
-}

+ 0
- 70
src/arch/e1/core/e132_xs.c View File

@@ -1,70 +0,0 @@
1
-/*
2
- * Copyright 2003 Yannis Mitsos and George Thanos 
3
- * {gmitsos@gthanos}@telecom.ntua.gr
4
- * Released under GPL2, see the file COPYING in the top directory
5
- *
6
- */
7
-#include "hooks.h"
8
-#include "io.h"
9
-#include "etherboot.h"
10
-#include "e132_xs_board.h"
11
-
12
-unsigned int io_periph[NR_CS] = {[0 ... NR_CS-1] = 0 };
13
-
14
-/*
15
-void arch_main(struct Elf_Bhdr *ptr __unused)
16
-{
17
-
18
-}
19
-*/
20
-
21
-void init_peripherals(void)
22
-{
23
-	int i;
24
-
25
-	for(i=0; i< NR_CS; i++){
26
-		io_periph[i]= (SLOW_IO_ACCESS | i << 22);
27
-	}
28
-
29
-	io_periph[ETHERNET_CS] = (io_periph[ETHERNET_CS] | 1 << IOWait);
30
-
31
-	asm volatile("
32
-			ori SR, 0x20
33
-			movi FCR, 0x66ffFFFF"
34
-			:
35
-			:);
36
-}
37
-
38
-struct meminfo meminfo;
39
-void get_memsizes(void)
40
-{
41
-/* We initialize the meminfo structure 
42
- * according to our development board's specs
43
- * We do not have a way to automatically probe the 
44
- * memspace instead we initialize it manually
45
- */
46
-	meminfo.basememsize = BASEMEM;
47
-	meminfo.memsize = 	SDRAM_SIZE;
48
-	meminfo.map_count = NR_MEMORY_REGNS;
49
-
50
-	meminfo.map[0].addr = SDRAM_BASEMEM;
51
-	meminfo.map[0].size = SDRAM_SIZE;
52
-	meminfo.map[0].type = E820_RAM;
53
-	meminfo.map[1].addr = SRAM_BASEMEM;
54
-	meminfo.map[1].size = SRAM_SIZE;
55
-	meminfo.map[1].type = E820_RAM;
56
-	meminfo.map[2].addr = IRAM_BASEMEM;
57
-	meminfo.map[2].size = IRAM_SIZE;
58
-	meminfo.map[2].type = E820_RAM;
59
-}
60
-
61
-int mach_boot(register unsigned long entry_point)
62
-{
63
-		asm volatile(
64
-					 "mov PC, %0"
65
-					: /* no outputs */
66
-					: "l" (entry_point) );
67
-		return 0; /* We should never reach this point ! */
68
-
69
-}
70
-

+ 0
- 97
src/arch/e1/core/e1_timer.c View File

@@ -1,97 +0,0 @@
1
-/*
2
- * Copyright 2003 Yannis Mitsos and George Thanos 
3
- * {gmitsos@gthanos}@telecom.ntua.gr
4
- * Released under GPL2, see the file COPYING in the top directory
5
- *
6
- */
7
-#include "etherboot.h"
8
-#include "timer.h"
9
-#include "e132_xs_board.h"
10
-#include "init.h"
11
-
12
-/* get timer returns the contents of the timer */
13
-static inline unsigned long get_timer(void)
14
-{
15
-	unsigned long result;
16
-	__asm__ __volatile__("
17
-					ORI	SR, 0x20
18
-					mov	%0, TR" 
19
-					: "=l"(result));
20
-	return result;
21
-}
22
-
23
-/* ------ Calibrate the TSC ------- 
24
- * Time how long it takes to excute a loop that runs in known time.
25
- * And find the convertion needed to get to CLOCK_TICK_RATE
26
- */
27
-
28
-static unsigned long configure_timer(void)
29
-{
30
-	unsigned long TPR_value; /* Timer Prescalar Value */
31
-
32
-	TPR_value = 0x000C00000;
33
-	
34
-	asm volatile (" 
35
-				FETCH   4	
36
-				ORI		SR, 0x20
37
-				MOV		TPR, %0
38
-				ORI		SR, 0x20
39
-				MOVI	TR, 0x0"
40
-				: /* no outputs */
41
-				: "l" (TPR_value)
42
-				); 
43
-
44
-	printf("The time prescaler register is set to: <%#x>\n",TPR_value);
45
-	return (1);
46
-}
47
-
48
-static unsigned long clocks_per_tick;
49
-
50
-static void setup_timers(void)
51
-{
52
-	if (!clocks_per_tick) {
53
-		clocks_per_tick = configure_timer();
54
-	}
55
-}
56
-
57
-unsigned long currticks(void)
58
-{
59
-	return get_timer()/clocks_per_tick;
60
-}
61
-
62
-static unsigned long timer_timeout;
63
-static int __timer_running(void)
64
-{
65
-	return get_timer() < timer_timeout;
66
-}
67
-
68
-void udelay(unsigned int usecs)
69
-{
70
-	unsigned long now;
71
-	now = get_timer();
72
-	timer_timeout = now + usecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000));
73
-	while(__timer_running());
74
-}
75
-void ndelay(unsigned int nsecs)
76
-{
77
-	unsigned long now;
78
-	now = get_timer();
79
-	timer_timeout = now + nsecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000*1000));
80
-	while(__timer_running());
81
-}
82
-
83
-void load_timer2(unsigned int timer2_ticks)
84
-{
85
-	unsigned long now;
86
-	unsigned long clocks;
87
-	now = get_timer();
88
-	clocks = timer2_ticks * ((clocks_per_tick * TICKS_PER_SEC)/CLOCK_TICK_RATE);
89
-	timer_timeout = now + clocks;
90
-}
91
-
92
-int timer2_running(void)
93
-{
94
-	return __timer_running();
95
-}
96
-
97
-INIT_FN ( INIT_TIMERS, setup_timers, NULL, NULL );

+ 0
- 126
src/arch/e1/core/etherboot.lds View File

@@ -1,126 +0,0 @@
1
-/* Default linker script, for normal executables */
2
-OUTPUT_FORMAT("coff-e1-big")
3
-MEMORY
4
-	{
5
-        romvec   : ORIGIN = 0x2000000,  LENGTH = 0x0000400
6
-        flash    : ORIGIN = 0xE0000000, LENGTH = 0x20000 
7
-        eflash   : ORIGIN = 0x2200000,  LENGTH = 0x20000
8
-        ram      : ORIGIN = 0x00000000, LENGTH = 0x1000000
9
-        eram16MB : ORIGIN = 0x01000000, LENGTH = 0
10
-        sram     : ORIGIN = 0x40000000, LENGTH = 0x40000
11
-		iram     : ORIGIN = 0xC0000000, LENGTH = 0x4000
12
-	}
13
-
14
-SEARCH_DIR("/usr/local/e1-coff/lib");
15
-ENTRY(Main)
16
-MEM0start   = 0x00000000;
17
-MEM0size    = 0x40000000;
18
-MEM1start   = 0x40000000;
19
-MEM1size    = 0x40000000;
20
-MEM2start   = 0x80000000;
21
-MEM2size    = 0x40000000;
22
-IRAMstart   = 0xC0000000;
23
-IRAMsize    = 0x20000000;
24
-MEM3start   = 0xE0000000;
25
-MEM3size    = 0x20000000;
26
-Stack1Reserve = 560;
27
-_Stack1Size = DEFINED(_Stack1Size)? _Stack1Size : 1*1024;
28
-_Stack2Size = DEFINED(_Stack2Size)? _Stack2Size : 16*1024;
29
-_Stack1Base = DEFINED(_Stack1Base)? _Stack1Base : __bss_end__;
30
-_Stack2Base = DEFINED(_Stack2Base)? _Stack2Base : __bss_end__ + _Stack1Size + Stack1Reserve;
31
-_Mem0HeapBase = DEFINED(_Mem0HeapBase)? _Mem0HeapBase : _Stack2Base + _Stack2Size;
32
-_Mem1HeapBase = DEFINED(_Mem1HeapBase)? _Mem1HeapBase : 0;
33
-Priority    = DEFINED(Priority)   ? Priority    : 31;
34
-TextBase    = DEFINED(TextBase)   ? TextBase    : 0xa00000;
35
-SECTIONS
36
-{
37
-  .G6 (DEFINED(G6Base) ? G6Base : 0x9000) : {
38
-    *(.G6)
39
-  }
40
-  .G7 (DEFINED(G7Base) ? G7Base : 0x40001000) : {
41
-    *(.G7)
42
-  }
43
-  .G8 (DEFINED(G8Base) ? G8Base : 0xC0000000) : {
44
-    *(.G8)
45
-  }
46
-  .G9 (DEFINED(G9Base) ? G9Base : 0) : {
47
-    *(.G9)
48
-  }
49
-  .G10 (DEFINED(G10Base) ? G10Base : 0) : {
50
-    *(.G10)
51
-  }
52
-  .G11 (DEFINED(G11Base) ? G11Base : 0) : {
53
-    *(.G11)
54
-  }
55
-  .G12 (DEFINED(G12Base) ? G12Base : 0) : {
56
-    *(.G12)
57
-  }
58
-  .G13 (DEFINED(G13Base) ? G13Base : 0) : {
59
-    *(.G13)
60
-  }
61
-
62
-  .text TextBase : {
63
-	__virt_start = .;
64
-	__text = . ;
65
-    *(.text)
66
-    *(.fini)
67
- 		. = ALIGN(16);
68
-		_isa_drivers = . ;
69
-		*(.drivisa);
70
-		_isa_drivers_end = . ;
71
-		. = ALIGN(16);
72
-
73
-   *(.init)
74
-  _etext  =  . ;
75
-    /* _init = DEFINED(_init) ? _init : 0; */
76
-    /* _fini = DEFINED(_fini) ? _fini : 0; */
77
-    /* _argc = DEFINED(_argc) ? _argc : 0; */
78
-    /* _argv = DEFINED(_argv) ? _argv : 0; */
79
-    /* _envp = DEFINED(_envp) ? _envp : 0; */
80
-    /* _hwinit = DEFINED(_hwinit) ? _hwinit : 0; */
81
-    /* _atexit = DEFINED(_atexit) ? _atexit : 0; */
82
-    G6Size = SIZEOF(.G6);
83
-    G7Size = SIZEOF(.G7);
84
-    G8Size = SIZEOF(.G8);
85
-    G9Size = SIZEOF(.G9);
86
-    G10Size = SIZEOF(.G10);
87
-    G11Size = SIZEOF(.G11);
88
-    G12Size = SIZEOF(.G12);
89
-    G13Size = SIZEOF(.G13);
90
-
91
-}
92
-
93
-  .data  SIZEOF(.text) + ADDR(.text) : {
94
-    *(.data)
95
-     _edata  =  . ;
96
-}
97
-
98
-  .bss  SIZEOF(.data) + ADDR(.data) : 
99
-  {
100
-     __bss_start__ = ALIGN( 0x10 ) ;
101
-     __bss = . ;
102
-    *(.bss)
103
-    *(COMMON)
104
-     __end = . ;
105
-     __bss_end__ = ALIGN( 0x10 ) ;
106
-     __ebss = . ;
107
-  }
108
-
109
-.eram16MB :    
110
-	{
111
-	___ramend = . - 0x7000;
112
-	} > eram16MB
113
-
114
-  .stab  0 (NOLOAD) :
115
-  {
116
-    [ .stab ]
117
-  }
118
-  .stabstr  0 (NOLOAD) :
119
-  {
120
-    [ .stabstr ]
121
-  }
122
-  _GOT_  0 (NOLOAD) :
123
-  {
124
-    [ _GOT_ ]
125
-  }
126
-}

+ 0
- 35
src/arch/e1/core/longjmp.c View File

@@ -1,35 +0,0 @@
1
-/*
2
- * Copyright 2003 Yannis Mitsos and George Thanos 
3
- * {gmitsos@gthanos}@telecom.ntua.gr
4
- * Released under GPL2, see the file COPYING in the top directory
5
- *
6
- */
7
-#include "setjmp.h"
8
-
9
-unsigned long jmpbuf_ptr;
10
-
11
-void longjmp(jmp_buf state, int value )
12
-{
13
-	if(!value)
14
-		state->__jmpbuf->ReturnValue = 1;
15
-	else
16
-		state->__jmpbuf->ReturnValue = value;
17
-
18
-	jmpbuf_ptr = (unsigned long)state; 
19
-
20
-#define _state_ ((struct __jmp_buf_tag*)jmpbuf_ptr)
21
-	asm volatile("mov L0, %0\n\t"
22
-		     "mov L1, %1\n\t"
23
-		     "mov L2, %2\n\t"
24
-		     "mov G3, %3\n\t"
25
-		     "mov G4, %4\n\t"
26
-		     "ret PC, L1\n\t"
27
-		     :/*no output*/
28
-		     :"l"(_state_->__jmpbuf->ReturnValue),
29
-		      "l"(_state_->__jmpbuf->SavedPC),
30
-		      "l"(_state_->__jmpbuf->SavedSR),
31
-		      "l"(_state_->__jmpbuf->G3),
32
-		      "l"(_state_->__jmpbuf->G4)
33
-		     :"%G3", "%G4", "%L0", "%L1" );
34
-#undef _state_
35
-}

+ 0
- 54
src/arch/e1/core/memcmp.S View File

@@ -1,54 +0,0 @@
1
-/*
2
- * Derived from the Hyperstone's library source code.
3
- * Modefied src in order to apply the -mgnu-param compiler option.
4
- * Copyright (C) 2002-2003 GDT, Yannis Mitsos <gmitsos@telecom.ntua.gr>
5
- *                              George Thanos <gthanos@telecom.ntua.gr>
6
- */
7
-	    .text
8
-	    .align   2
9
-	    .global  _memcmp
10
-
11
-;ENTRY (_memcmp)
12
-_memcmp:
13
-	    FRAME    L9, L3                 # get incoming parameters
14
-	    CMPBI    L2,3                   # check word alignment
15
-	    BNZ      byte_compare
16
-	    CMPBI    L1,3                   # check word alignment
17
-	    BNZ      byte_compare
18
-
19
-double_compare:
20
-	    ADDI     L0, -8
21
-	    BLT      is_equal
22
-	    LDD.P    L1, L5
23
-	    LDD.P    L2, L7
24
-	    SUB      L5, L7
25
-	    DBNZ     corr_8
26
-	    SUB      L6, L8
27
-	    BZ       double_compare
28
-	    ADDI     L0, 4
29
-	    ADDI     L2, -4
30
-	    ADDI     L1, -4
31
-	    BR       byte_compare
32
-
33
-corr_8:     ADDI     L0, 8
34
-	    ADDI     L2, -8
35
-	    ADDI     L1, -8
36
-byte_compare:
37
-	    ADDI     L0, -1
38
-	    BLT      equal
39
-	    LDBU.N   L2, L5, 1              # Load and compare bytes
40
-	    LDBU.N   L1, L6, 1
41
-	    SUB      L5, L6
42
-	    BZ       byte_compare
43
-	    MOV      L2, L5
44
-	    RET      PC, L3
45
-
46
-is_equal:   CMPI     L0, -8
47
-	    DBNE     byte_compare
48
-	    ADDI     L0, 8
49
-equal:
50
-	    MOVI     L2, 0
51
-	    RET      PC, L3
52
-
53
-	    .END
54
-

+ 0
- 79
src/arch/e1/core/memcpy.S View File

@@ -1,79 +0,0 @@
1
-/*
2
- * Derived from the Hyperstone's library source code.
3
- * Modefied src in order to apply the -mgnu-param compiler option.
4
- * Copyright (C) 2002-2003 GDT, Yannis Mitsos <gmitsos@telecom.ntua.gr>
5
- *                              George Thanos <gthanos@telecom.ntua.gr>
6
- */    
7
-		.text
8
-	    .align   2
9
-	    .global  _memcpy
10
-;ENTRY(_memcpy)
11
-_memcpy:
12
-	    FRAME    L8, L3
13
-	    MOV      L7, L2                 # Save for return
14
-
15
-#*****************************
16
-# Perform byte copy if both
17
-# not on a word alignment
18
-#*****************************
19
-	    CMPBI    L2, 3                  # check word alignment
20
-            BNZ      mem_except
21
-	    CMPBI    L1, 3                  # check word alignment
22
-            BNZ      mem_except
23
-
24
-#*****************************
25
-# Copy Double,Word,Halfword,
26
-# then byte
27
-#*****************************
28
-DBL_LOOP:
29
-	    CMPI     L0, 8                  # Copy Doubles
30
-            BLT      DO_WORD
31
-            LDD.P    L1, L5
32
-            ADDI     L0, -8
33
-            DBR      DBL_LOOP
34
-            STD.P    L2, L5
35
-
36
-DO_WORD:
37
-	   CMPI      L0, 4                  # Copy leftover word
38
-           BLT       DO_HALF
39
-	   LDW.P     L1, L5
40
-           ADDI      L0, -4
41
-	   DBZ       DONE                   # Done if L0 is 0
42
-           STW.P     L2, L5
43
-
44
-DO_HALF:
45
-	   CMPI      L0, 2                  # Copy leftover byte
46
-           BLT       DO_BYTE
47
-           LDHU.N    L1, L5, 2
48
-           ADDI      L0, -2
49
-	   DBZ       DONE                   # Done if L0 is 0
50
-           STHU.N    L2, L5, 2
51
-
52
-DO_BYTE:
53
-	   CMPI      L0, 1                  # Copy leftover byte
54
-           BLT       DONE
55
-           LDBU.D    L1, L5, 0
56
-           STBU.D    L2, L5, 0
57
-
58
-DONE:                                       # Copy done
59
-	   MOV       L2, L7                 # Return pointer
60
-           RET       PC, L3
61
-
62
-#****************************
63
-# Byte memcpy
64
-#****************************
65
-mem_except:
66
-           DBR       L_5
67
-           MOVI      L6,0
68
-L_3:
69
-	   LDBS.D    L1, L5, 0              # Transfer the byte
70
-           ADDI      L6, 1
71
-           STBS.D    L2, L5, 0
72
-           ADDI      L2, 1
73
-           ADDI      L1, 1
74
-L_5:                                        # Loop test
75
-           CMP       L6, L0
76
-	   BST       L_3
77
-	   MOV       L2, L7                 # Return pointer
78
-	   RET       PC, L3
79
-	   .END

+ 0
- 47
src/arch/e1/core/memset.S View File

@@ -1,47 +0,0 @@
1
-/*
2
- * Derived from the Hyperstone's library source code.
3
- * Modefied src in order to apply the -mgnu-param compiler option.
4
- * Copyright (C) 2002-2003 GDT, Yannis Mitsos <gmitsos@telecom.ntua.gr>
5
- *                              George Thanos <gthanos@telecom.ntua.gr>
6
- */      
7
-		.text
8
-	    .align   2
9
-		.global _memset
10
-
11
-;ENTRY(_memset)
12
-_memset:    FRAME    L9, L3
13
-	    MASK     L5, L1, 0xFF
14
-	    MOV      L8, L2
15
-	    CMPI     L0, 0                  # if n = 0 then return
16
-            BE       retour
17
-
18
-loop0:      CMPBI    L8, 0x3
19
-	    BZ       word_bound
20
-	    ADDI     L0, -1
21
-	    DBNZ     loop0
22
-	    STBU.N   L8, L5, 1
23
-retour:     RET      PC, L3
24
-
25
-word_bound:
26
-	    CMPI     L0, 8
27
-	    DBLT     loop2
28
-	    MOV      L7, L5
29
-	    SHLI     L7, 8
30
-            OR       L5, L7
31
-            MOV      L7, L5
32
-            SHLI     L7, 16
33
-            OR       L5, L7
34
-            MOV      L6, L5
35
-loop1:      ADDI     L0, -8
36
-            CMPI     L0, 8
37
-            DBGE     loop1
38
-	    STD.P    L8, L5
39
-            CMPI     L0, 0
40
-            DBNZ     loop2
41
-	    ANDNI    L5, ~ 0xFF
42
-	    RET      PC, L3
43
-
44
-loop2:      ADDI     L0, -1
45
-	    DBNZ     loop2
46
-	    STBU.N   L8, L5, 1
47
-	    RET      PC, L3

+ 0
- 26
src/arch/e1/core/setjmp.c View File

@@ -1,26 +0,0 @@
1
-/*
2
- * Copyright 2003 Yannis Mitsos and George Thanos 
3
- * {gmitsos@gthanos}@telecom.ntua.gr
4
- * Released under GPL2, see the file COPYING in the top directory
5
- *
6
- */
7
-#include "setjmp.h"
8
-
9
-int setjmp( jmp_buf state)
10
-{
11
-	asm volatile(	"mov %0, G3\n\t"           
12
-			"mov %1, G4\n\t" 
13
-			:"=l"(state->__jmpbuf->G3), 
14
-			 "=l"(state->__jmpbuf->G4) 
15
-			:/*no input*/ 
16
-			:"%G3", "%G4" );
17
-
18
-	asm volatile(   "setadr  %0\n\t"
19
-			"mov %1, L1\n\t"
20
-			"mov %2, L2\n\t"
21
-			:"=l"(state->__jmpbuf->SavedSP),
22
-			 "=l"(state->__jmpbuf->SavedPC),
23
-			 "=l"(state->__jmpbuf->SavedSR)
24
-			:/*no input*/);
25
-	return 0;
26
-}

+ 0
- 111
src/arch/e1/core/start.S View File

@@ -1,111 +0,0 @@
1
-/*
2
- * Derived from the Hyperstone's library source code.
3
- * Copyright (C) 2002-2003 GDT, Yannis Mitsos <gmitsos@telecom.ntua.gr>
4
- *                              George Thanos <gthanos@telecom.ntua.gr>
5
- */    
6
-	.global	Priority	; Task-Priority
7
-	.global	_Stack1Size	; Size of hardware stack
8
-	.global	_Stack2Size	; Size of aggregate stack
9
-	.global	_Stack1Base	; Base of hardware stack
10
-	.global	_Stack2Base	; Base of aggregate stack
11
-	.global	_Mem0HeapBase	; Base of Heap in Mem0
12
-	.global	_Mem1HeapBase	; Base of Heap in Mem1
13
-
14
-	.global _init_peripherals
15
-	.global	_main
16
-	.global	Main
17
-
18
-	.global	__exit
19
-	.global	__fmode
20
-	.global	__MaxArgCount
21
-
22
-	.text
23
-BasePtrs:
24
-	.weak	G6Base,G7Base,G8Base,G9Base,G10Base,G11Base,G12Base,G13Base
25
-	.long	G6Base,G7Base,G8Base,G9Base,G10Base,G11Base,G12Base,G13Base
26
-BasePtrsEnd:
27
-HeapPtrs:
28
-	.long	_Mem0HeapBase
29
-	.long	_Mem1HeapBase
30
-HeapPtrsEnd:
31
-
32
-__MaxArgCount:
33
-        .long	32
34
-__StandAloneMode:
35
-	.long	0		; 0 indicate stand alone mode
36
-
37
-;============================================================================;
38
-; Startup-Code                                                               ;
39
-;============================================================================;
40
-	.data
41
-
42
-; do not change the order of: __argc,..
43
-__argc:	
44
-	.long  0
45
-__argv:	
46
-	.long  0
47
-__IsShell:
48
-	.long  1
49
-ErrorLevel:
50
-	.long  0
51
-__lab:	
52
-	.long  0
53
-__fmode:
54
-	.long	0x4000		; O_TEXT    attribute
55
-
56
-_isa_drivers:
57
-	.long	0
58
-
59
-_isa_drivers_end:
60
-	.long	0
61
-
62
-
63
-	.text
64
-Main:
65
-StartUp:
66
-	FRAME	L5, L0
67
-	MOVI	L2, __bss_start__	; clear the .bss segment
68
-0:	CMPI	L2, __bss_end__
69
-	BHE	0f
70
-	DBR	0b
71
-	STW.P	L2, 0
72
-0:	SUM     L2, PC, BasePtrs-$	; Load BasePtrs G6-G13
73
-	LDD.P   L2, G6
74
-	LDD.P   L2, G8
75
-;	LDD.P   L2, G10
76
-	LDD.P   L2, G12
77
-	MOVI    L2, 1
78
-	SUM     L3, PC, __StandAloneMode-$
79
-	STW.R   L3, L2
80
-
81
-	;----------------------------------------------------------------;
82
-	; Call main C function                                           ;
83
-	;----------------------------------------------------------------;
84
-2:	LDW.D	PC, L2, __argc - $	; pass count of arguments to main
85
-	LDW.D   PC, L3, __argv - $	; pass pointer array to main
86
-	CALL	L4, PC, _init_peripherals - $ 
87
-	CALL    L4, PC, _main - $	; --> Call Main-Program
88
-	CHK     PC, PC			; trap if execution arrives here
89
-
90
-__exit:
91
-	FRAME   L5, L1
92
-	STW.D   PC, L0, ErrorLevel - $	; Store ERRORLEVEL
93
-
94
-	CHK     PC, PC
95
-	RET     PC, L1
96
-
97
-	.global ___main
98
-___main:
99
-	FRAME   L4, L1
100
-	MOVI    L3, 2
101
-	STW.D   PC, L3, __StandAloneMode-$
102
-	RET     PC, L1		; does not return
103
-
104
-	.section _GOT_
105
-	.long   Main+4		; OnCreate
106
-	.long   Main+8		; OnError
107
-	.long   BasePtrs	; G6
108
-	.long   BasePtrs+4	; G7
109
-	.long   BasePtrs+8	; G8
110
-	
111
-	.END

+ 0
- 76
src/arch/e1/core/strcmp.S View File

@@ -1,76 +0,0 @@
1
-/*
2
- * Derived from the Hyperstone's library source code.
3
- * Modefied src in order to apply the -mgnu-param compiler option.
4
- * Copyright (C) 2002-2003 GDT, Yannis Mitsos <gmitsos@telecom.ntua.gr>
5
- *                              George Thanos <gthanos@telecom.ntua.gr>
6
- */
7
-        .text
8
-	    .align   2
9
-	    .global  _strcmp
10
-;ENTRY(_strcmp)
11
-_strcmp:
12
-	    FRAME    L8,L2
13
-	    CMPBI    L1, 3        # check for word alignment
14
-	    BNZ      str_except
15
-	    CMPBI    L0, 3        # check for word alignment
16
-	    BNZ      str_except
17
-
18
-start:
19
-	    LDD.P    L1, L4       # post inc mode
20
-	    LDD.P    L0, L6       # post inc mode
21
-            CMPBI    L4, ANYBZ
22
-            BE       correct1
23
-            CMP      L4, L6
24
-            BNE      correct1
25
-            CMP      L5, L7
26
-            BNE      correct
27
-            CMPBI    L5, ANYBZ
28
-            BE       correct
29
-            CMPBI    L6, ANYBZ
30
-            BE       correct1
31
-            CMPBI    L7, ANYBZ
32
-            BNE      start
33
-
34
-correct:    MASK     L4, L5, 0xff000000
35
-	    MASK     L6, L7, 0xff000000
36
-            CMP      L4, L6
37
-            BNE      Exit
38
-            SHLI     L5, 8
39
-            CMPI     L4, 0
40
-            DBNE     correct
41
-            SHLI     L7, 8
42
-            MOV      L1, L4
43
-            RET      PC, L2
44
-
45
-Exit:       SUB      L4, L6       # Subtract chars
46
-            SARI     L4, 24
47
-            MOV      L1, L4
48
-            RET      PC, L2
49
-
50
-correct1:   MASK     L5, L4, 0xff000000
51
-	    MASK     L7, L6, 0xff000000
52
-            CMP      L5, L7
53
-            BNE      Exit1
54
-            SHLI     L4, 8
55
-            CMPI     L5, 0
56
-            DBNE     correct1
57
-            SHLI     L6, 8
58
-            MOV      L1, L5
59
-            RET      PC, L2
60
-Exit1:      SUB      L5, L7       # Subtract chars
61
-            SARI     L5, 24
62
-            MOV      L1, L5
63
-            RET      PC, L2
64
-
65
-testzero:   CMPI     L4, 0
66
-            BE       L_5
67
-str_except:
68
-	    LDBU.N   L1, L4, 1    # Load *s1, compare bytes
69
-	    LDBU.N   L0, L5, 1    # Load *s2, compare bytes
70
-            CMP      L4, L5
71
-	    BE       testzero
72
-	    SUB      L4, L5       # Subtract chars
73
-L_5:        MOV      L1, L4
74
-	    RET      PC, L2
75
-	    .END
76
-

+ 0
- 39
src/arch/e1/include/bits/byteswap.h View File

@@ -1,39 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_BYTESWAP_H
2
-#define ETHERBOOT_BITS_BYTESWAP_H
3
-
4
-/* We do not have byte swap functions ... We are
5
- * RISC processor ...
6
- */
7
-
8
-static inline unsigned short __swap16(volatile unsigned short v)
9
-{
10
-    return ((v << 8) | (v >> 8));
11
-}
12
-
13
-static inline unsigned int __swap32(volatile unsigned long v)
14
-{
15
-    return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
16
-}
17
-
18
-#define __bswap_constant_16(x) \
19
-	((uint16_t)((((uint16_t)(x) & 0x00ff) << 8) | \
20
-		(((uint16_t)(x) & 0xff00) >> 8)))
21
-
22
-#define __bswap_constant_32(x) \
23
-	((uint32_t)((((uint32_t)(x) & 0x000000ffU) << 24) | \
24
-		(((uint32_t)(x) & 0x0000ff00U) <<  8) | \
25
-		(((uint32_t)(x) & 0x00ff0000U) >>  8) | \
26
-		(((uint32_t)(x) & 0xff000000U) >> 24)))
27
-
28
-#define __bswap_16(x) \
29
-	(__builtin_constant_p(x) ? \
30
-	__bswap_constant_16(x) : \
31
-	__swap16(x))
32
-
33
-
34
-#define __bswap_32(x) \
35
-	(__builtin_constant_p(x) ? \
36
-	__bswap_constant_32(x) : \
37
-	__swap32(x))
38
-
39
-#endif /* ETHERBOOT_BITS_BYTESWAP_H */

+ 0
- 6
src/arch/e1/include/bits/cpu.h View File

@@ -1,6 +0,0 @@
1
-#ifndef E1_BITS_CPU_H
2
-#define E1_BITS_CPU_H
3
-
4
-#define cpu_setup() do {} while(0)
5
-
6
-#endif /* E1_BITS_CPU_H */

+ 0
- 6
src/arch/e1/include/bits/elf.h View File

@@ -1,6 +0,0 @@
1
-#ifndef E1_BITS_ELF_H
2
-#define E1_BITS_ELF_H
3
-
4
-/* dummy file, needed for the compilation of core/nic.c */
5
-
6
-#endif /* E1_BITS_ELF_H */

+ 0
- 6
src/arch/e1/include/bits/endian.h View File

@@ -1,6 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_ENDIAN_H
2
-#define ETHERBOOT_BITS_ENDIAN_H
3
-
4
-#define __BYTE_ORDER __BIG_ENDIAN
5
-
6
-#endif /* ETHERBOOT_BITS_ENDIAN_H */

+ 0
- 35
src/arch/e1/include/bits/string.h View File

@@ -1,35 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_STRING_H
2
-#define ETHERBOOT_BITS_STRING_H
3
-
4
-/* define inline optimized string functions here */
5
-
6
-#define	__HAVE_ARCH_MEMCPY
7
-//extern void * memcpy(const void *d, const void *s, size_t count);
8
-
9
-#define __HAVE_ARCH_MEMCMP
10
-//extern int memcmp(const void * s ,const void * d ,size_t );
11
-
12
-#define __HAVE_ARCH_MEMSET
13
-//extern void * memset(const void * s, int c, size_t count);
14
-
15
-#define __HAVE_ARCH_MEMMOVE
16
-static inline void *memmove(void *s1, const void *s2, size_t n) {
17
-
18
-   unsigned int i;
19
-   char *tmp = s1;
20
-   char *cs2 = (char *) s2;
21
-
22
-   if (tmp < cs2) {
23
-      for(i=0; i<n; ++i, ++tmp, ++cs2)
24
-           *tmp =  *cs2;
25
-   }
26
-   else {
27
-      tmp += n - 1;
28
-      cs2 += n - 1;
29
-      for(i=0; i<n; ++i, --tmp, --cs2)
30
-              *tmp = *cs2;
31
-   }
32
-   return(s1);
33
-}
34
-
35
-#endif /* ETHERBOOT_BITS_STRING_H */

+ 0
- 22
src/arch/e1/include/e132_xs_board.h View File

@@ -1,22 +0,0 @@
1
-#ifndef __E132_XS_BOARD_H
2
-#define __E132_XS_BOARD_H
3
-
4
-#define CONFIG_HYPERSTONE_OSC_FREQ_MHZ	15
5
-
6
-#define NR_MEMORY_REGNS	3
7
-#define BASEMEM			0x0
8
-
9
-/* SDRAM mapping */
10
-#define	SDRAM_SIZE		0x01000000
11
-#define SDRAM_BASEMEM	BASEMEM	
12
-
13
-/* SRAM mapping */
14
-#define SRAM_BASEMEM	0x40000000
15
-#define SRAM_SIZE		0x0003FFFF
16
-
17
-/* IRAM mapping */
18
-#define IRAM_BASEMEM	0xC0000000
19
-#define IRAM_SIZE		0x00003FFF
20
-
21
-
22
-#endif /* __E132_XS_BOARD_H */

+ 0
- 9
src/arch/e1/include/hooks.h View File

@@ -1,9 +0,0 @@
1
-#ifndef ETHERBOOT_E1_HOOKS_H
2
-#define ETHERBOOT_E1_HOOKS_H
3
-
4
-#define arch_main(data,params) do {} while(0)
5
-#define arch_on_exit(status) do {} while(0)
6
-#define arch_relocate_to(addr) do {} while(0)
7
-#define arch_relocated_from(old_addr) do {} while(0)
8
-
9
-#endif /* ETHERBOOT_E1_HOOKS_H */

+ 0
- 210
src/arch/e1/include/io.h View File

@@ -1,210 +0,0 @@
1
-#ifndef ETHERBOOT_IO_H
2
-#define ETHERBOOT_IO_H
3
-
4
-/* Don't require identity mapped physical memory,
5
- * osloader.c is the only valid user at the moment.
6
- */
7
-#if 0
8
-static inline unsigned long virt_to_phys(volatile const void *virt_addr)
9
-{
10
-	return ((unsigned long)virt_addr);
11
-}
12
-#else
13
-#define virt_to_phys(vaddr)	((unsigned long) (vaddr))
14
-#endif
15
-
16
-#if 0
17
-static inline void *phys_to_virt(unsigned long phys_addr)
18
-{
19
-	return (void *)(phys_addr);
20
-}
21
-#else
22
-#define phys_to_virt(vaddr)	((void *) (vaddr))
23
-#endif
24
-
25
-/* virt_to_bus converts an addresss inside of etherboot [_start, _end]
26
- * into a memory address cards can use.
27
- */
28
-#define virt_to_bus virt_to_phys
29
-
30
-/* bus_to_virt reverses virt_to_bus, the address must be output
31
- * from virt_to_bus to be valid.  This function does not work on
32
- * all bus addresses.
33
- */
34
-#define bus_to_virt phys_to_virt
35
-
36
-#define iounmap(addr)				((void)0)
37
-#define ioremap(physaddr, size)			(physaddr)
38
-
39
-#define IORegAddress	13
40
-#define IOWait			11
41
-#define IOSetupTime		8
42
-#define IOAccessTime	5
43
-#define IOHoldTime		3
44
-
45
-#define SLOW_IO_ACCESS ( 0x3 << IOSetupTime | 0x0 << IOWait | 7 << IOAccessTime | 3 << IOHoldTime )
46
-
47
-/* The development board can generate up to 15 Chip selects */
48
-#define NR_CS	16
49
-
50
-extern unsigned int io_periph[NR_CS];
51
-#define ETHERNET_CS 4
52
-
53
-static inline unsigned short _swapw(volatile unsigned short v)
54
-{
55
-    return ((v << 8) | (v >> 8));
56
-}
57
-
58
-static inline unsigned int _swapl(volatile unsigned long v)
59
-{
60
-    return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
61
-}
62
-
63
-#define  hy_inpw(addr)  						\
64
-	({   register unsigned long dummy, dummy1; 			\
65
-		 dummy  = addr; 						\
66
-		 asm volatile  ("LDW.IOD   %1, %0, 0" 	\
67
-				 		: "=l" (dummy1) 		\
68
-					   	: "l" (dummy)); dummy1; })
69
-
70
-
71
-#define  hy_outpw(x, addr)						  \
72
-	({   register unsigned long dummy0,dummy1; \
73
-	 	 dummy0 = addr; 					  \
74
-		 dummy1 = x;						  \
75
-		 asm volatile  ("STW.IOD   %1, %0, 0" \
76
-						 : "=l" (dummy1) 	  \
77
-						 : "l"(dummy0), "l" (dummy1)); dummy1; })
78
-
79
-#define readb(addr)	({ unsigned char  __v = inregb(addr); __v; })
80
-#define readw(addr)	({ unsigned short __v = inregw(addr); __v; })
81
-#define readl(addr)	({ unsigned long  __v = inregl(addr); __v; })
82
-
83
-#define writeb(b,addr) (void)(outreg(b, addr))
84
-#define writew(b,addr) (void)(outreg(b, addr))
85
-#define writel(b,addr) (void)(outreg(b, addr))
86
-
87
-static inline unsigned long common_io_access(unsigned long addr)
88
-{
89
-	return io_periph[(addr & 0x03C00000) >> 22];
90
-}
91
-
92
-static inline volatile unsigned char inregb(volatile unsigned long reg)
93
-{
94
-	unsigned char val;
95
-
96
-	val = hy_inpw(common_io_access(reg) | ((0xf & reg) << IORegAddress)); 
97
-	return val;
98
-}
99
-
100
-static inline volatile unsigned short inregw(volatile unsigned long reg)
101
-{
102
-	unsigned short val;
103
-
104
-	val = hy_inpw(common_io_access(reg) | ((0xf & reg) << IORegAddress)); 
105
-	return val;
106
-}
107
-
108
-static inline volatile unsigned long inregl(volatile unsigned long reg)
109
-{
110
-	unsigned long val;
111
-
112
-	val = hy_inpw(common_io_access(reg) | ((0xf & reg) << IORegAddress)); 
113
-	return val;
114
-}
115
-
116
-static inline void outreg(volatile unsigned long val, volatile unsigned long reg)
117
-{
118
-		
119
-	hy_outpw(val, (common_io_access(reg) | ((0xf & reg) << IORegAddress)));
120
-}
121
-
122
-static inline void io_outsb(unsigned int addr, void *buf, int len)
123
-{
124
-	unsigned long tmp;
125
-	unsigned char *bp = (unsigned char *) buf;
126
-
127
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
128
-
129
-	while (len--){
130
-		hy_outpw(_swapw(*bp++), tmp);
131
-	}
132
-}
133
-
134
-static inline void io_outsw(volatile unsigned int addr, void *buf, int len)
135
-{
136
-	unsigned long tmp;
137
-	unsigned short *bp = (unsigned short *) buf;
138
-	
139
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
140
-
141
-	while (len--){
142
-		hy_outpw(_swapw(*bp++), tmp);
143
-	}
144
-}
145
-
146
-static inline void io_outsl(volatile unsigned int addr, void *buf, int len)
147
-{
148
-	unsigned long tmp;
149
-	unsigned int *bp = (unsigned int *) buf;
150
-		
151
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
152
-
153
-	while (len--){
154
-		hy_outpw(_swapl(*bp++), tmp);
155
-	}
156
-}
157
-
158
-static inline void io_insb(volatile unsigned int addr, void *buf, int len)
159
-{
160
-	unsigned long tmp;
161
-	unsigned char *bp = (unsigned char *) buf;
162
-
163
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
164
-
165
-	while (len--)
166
-		*bp++ = hy_inpw((unsigned char) tmp);
167
-	
168
-}
169
-
170
-static inline void io_insw(unsigned int addr, void *buf, int len)
171
-{
172
-	unsigned long tmp;
173
-	unsigned short *bp = (unsigned short *) buf;
174
-
175
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
176
-
177
-	while (len--)
178
-		*bp++ = _swapw((unsigned short)hy_inpw(tmp));
179
-
180
-}
181
-
182
-static inline void io_insl(unsigned int addr, void *buf, int len)
183
-{
184
-	unsigned long tmp;
185
-	unsigned int *bp = (unsigned int *) buf;
186
-
187
-	tmp = (common_io_access(addr)) | ((0xf & addr) << IORegAddress);
188
-
189
-	while (len--)
190
-		*bp++ = _swapl((unsigned int)hy_inpw(tmp));
191
-}
192
-
193
-#define inb(addr)    readb(addr)
194
-#define inw(addr)    readw(addr)
195
-#define inl(addr)    readl(addr)
196
-#define outb(x,addr) ((void) writeb(x,addr))
197
-#define outw(x,addr) ((void) writew(x,addr))
198
-#define outl(x,addr) ((void) writel(x,addr))
199
-
200
-#define insb(a,b,l) io_insb(a,b,l)
201
-#define insw(a,b,l) io_insw(a,b,l)
202
-#define insl(a,b,l) io_insl(a,b,l)
203
-#define outsb(a,b,l) io_outsb(a,b,l)
204
-#define outsw(a,b,l) io_outsw(a,b,l)
205
-#define outsl(a,b,l) io_outsl(a,b,l)
206
-	
207
-#define memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
208
-#define memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))
209
-
210
-#endif /* ETHERBOOT_IO_H */

+ 0
- 12
src/arch/e1/include/latch.h View File

@@ -1,12 +0,0 @@
1
-#ifndef LATCH_H
2
-#define LATCH_H
3
-
4
-//#define TICKS_PER_SEC		(1000000UL)
5
-#define TICKS_PER_SEC		(625000UL)
6
-
7
-/* Fixed timer interval used for calibrating a more precise timer */
8
-//#define LATCHES_PER_SEC		10
9
-
10
-void sleep_latch(void);
11
-
12
-#endif /* LATCH_H */

+ 0
- 34
src/arch/e1/include/limits.h View File

@@ -1,34 +0,0 @@
1
-/*--------------------------------------------------------------------------*/
2
-/* Project:        ANSI C Standard Header Files                             */
3
-/* File:           LIMITS.H                                                 */
4
-/* Edited by:      hyperstone electronics GmbH                              */
5
-/*                 Am Seerhein 8                                            */
6
-/*                 D-78467 Konstanz, Germany                                */
7
-/* Date:           January 30, 1996                                         */
8
-/*--------------------------------------------------------------------------*/
9
-/* Purpose:                                                                 */
10
-/* The header file <limits.h> defines limits of ordinal types               */
11
-/* (char, short, int, long)                                                 */
12
-/*--------------------------------------------------------------------------*/
13
-
14
-#ifndef __LIMITS_H
15
-#define __LIMITS_H  1
16
-
17
-#define MB_LEN_MAX        1
18
-#define CHAR_BIT          8
19
-#define SCHAR_MIN         -128L
20
-#define SCHAR_MAX         127L
21
-#define UCHAR_MAX         255
22
-#define CHAR_MIN          0
23
-#define CHAR_MAX          UCHAR_MAX
24
-#define SHRT_MIN          -32768
25
-#define SHRT_MAX          32767
26
-#define USHRT_MAX         65535
27
-#define INT_MIN           0x80000000
28
-#define INT_MAX           0x7FFFFFFF
29
-#define UINT_MAX          0xFFFFFFFFL
30
-#define LONG_MIN          INT_MIN
31
-#define LONG_MAX          INT_MAX
32
-#define ULONG_MAX         UINT_MAX
33
-
34
-#endif

+ 0
- 23
src/arch/e1/include/setjmp.h View File

@@ -1,23 +0,0 @@
1
-#ifndef _SETJMP_H
2
-#define _SETJMP_H
3
-
4
-
5
-typedef struct {
6
-	unsigned long G3;
7
-	unsigned long G4;
8
-	unsigned long SavedSP;
9
-	unsigned long SavedPC;
10
-	unsigned long SavedSR;
11
-	unsigned long ReturnValue;
12
-} __jmp_buf[1];
13
-
14
-typedef struct __jmp_buf_tag	/* C++ doesn't like tagless structs.  */
15
-  {
16
-    __jmp_buf __jmpbuf;		/* Calling environment.  */
17
-    int __mask_was_saved;	/* Saved the signal mask?  */
18
-  } jmp_buf[1];
19
-
20
-void longjmp(jmp_buf state, int value );
21
-int setjmp( jmp_buf state);
22
-
23
-#endif

+ 0
- 28
src/arch/e1/include/stdint.h View File

@@ -1,28 +0,0 @@
1
-#ifndef STDINT_H
2
-#define STDINT_H
3
-
4
-typedef unsigned long      size_t;
5
-
6
-typedef unsigned char      uint8_t;
7
-typedef unsigned short     uint16_t;
8
-typedef unsigned long      uint32_t;
9
-typedef unsigned long long uint64_t;
10
-
11
-typedef signed char        int8_t;
12
-typedef signed short       int16_t;
13
-typedef signed int         int32_t;
14
-typedef signed long long   int64_t;
15
-
16
-typedef signed char        s8;
17
-typedef unsigned char      u8;
18
-
19
-typedef signed short       s16;
20
-typedef unsigned short     u16;
21
-
22
-typedef signed long        s32;
23
-typedef unsigned int       u32;
24
-
25
-typedef signed long long   s64;
26
-typedef unsigned long long u64;
27
-
28
-#endif /* STDINT_H */

+ 0
- 22
src/arch/ia64/Config View File

@@ -1,22 +0,0 @@
1
-# Config for ia64 Etherboot
2
-#
3
-# Do not delete the tag OptionDescription and /OptionDescription
4
-# It is used to automatically generate the documentation.
5
-#
6
-# @OptionDescrition@
7
-#
8
-#	BIOS interface options:
9
-#
10
-#	-DCONFIG_EFI
11
-#			Compile in support for EFI
12
-#
13
-# @/OptionDescription@
14
-
15
-CFLAGS+= -DCONSOLE_FIRMWARE
16
-CFLAGS+= -DCONFIG_EFI
17
-
18
-CFLAGS+=  -fpic -mconstant-gp -mauto-pic
19
-ASFLAGS+= -mconstant-gp -mauto-pic
20
-
21
-LDFLAGS+=	-static -shared -Bsymbolic --warn-multiple-gp --warn-common
22
-

+ 0
- 125
src/arch/ia64/Makefile View File

@@ -1,125 +0,0 @@
1
-ARCH_FORMAT=	elf64-ia64-little
2
-
3
-LCONFIG+=	
4
-
5
-
6
-BUILD_EFIS=	$(patsubst %.img, %.efi, $(IMGS)) $(patsubst %.img, %.zefi, $(IMGS))
7
-
8
-START=	$(BIN)/start.o $(BIN)/reloc.o 
9
-#START+=	$(BIN)/efi_main.o
10
-
11
-SRCS+=	arch/ia64/prefix/efi_prefix.S arch/ia64/prefix/unnrv2b.S
12
-SRCS+=	arch/ia64/core/__call.S 
13
-SRCS+=	arch/ia64/core/ia64_timer.c
14
-SRCS+=	arch/ia64/core/idiv32.S
15
-SRCS+=	arch/ia64/core/idiv64.S
16
-SRCS+=	arch/ia64/core/longjmp.S
17
-SRCS+=	arch/ia64/core/memmove.S
18
-SRCS+=	arch/ia64/core/memset.S
19
-SRCS+=	arch/ia64/core/pal.c
20
-SRCS+=	arch/ia64/core/pci_io.c
21
-SRCS+=	arch/ia64/core/reloc.S
22
-SRCS+=	arch/ia64/core/relocate_to.S
23
-SRCS+=	arch/ia64/core/sal.c
24
-SRCS+=	arch/ia64/core/setjmp.S
25
-SRCS+=	arch/ia64/core/start.S
26
-SRCS+=	arch/ia64/core/efi.c
27
-
28
-ROMLIMIT:=3276800
29
-
30
-include		$(BIN)/Roms
31
-
32
-# We need allefis because $(IMGS) is not defined until
33
-# the Makefile fragment "Roms" is read.
34
-allefis:	$(BUILD_EFIS)
35
-
36
-
37
-#BOBJS+=		$(BIN)/acpi.o 
38
-BOBJS+=		$(BIN)/sal.o $(BIN)/pal.o 
39
-BOBJS+=		$(BIN)/efi.o
40
-BOBJS+=		$(BIN)/memset.o $(BIN)/memmove.o
41
-BOBJS+=		$(BIN)/setjmp.o $(BIN)/longjmp.o
42
-BOBJS+=		$(BIN)/relocate_to.o $(BIN)/__call.o
43
-BOBJS+=		$(BIN)/pci_io.o $(BIN)/ia64_timer.o
44
-BOBJS+=		$(BIN)/__divdi3.o $(BIN)/__udivdi3.o $(BIN)/__moddi3.o $(BIN)/__umoddi3.o
45
-BOBJS+=		$(BIN)/__divsi3.o $(BIN)/__udivsi3.o $(BIN)/__modsi3.o $(BIN)/__umodsi3.o
46
-
47
-
48
-# IA64 Division routines
49
-$(BIN)/__divdi3.o:	arch/ia64/core/idiv64.S
50
-	$(CPP) $(CFLAGS) -DASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
51
-
52
-$(BIN)/__udivdi3.o:	arch/ia64/core/idiv64.S
53
-	$(CPP) $(CFLAGS) -DASSEMBLY -DUNSIGNED $< | $(AS) $(ASFLAGS) -o $@
54
-
55
-$(BIN)/__moddi3.o:	arch/ia64/core/idiv64.S
56
-	$(CPP) $(CFLAGS) -DASSEMBLY -DMODULO $< | $(AS) $(ASFLAGS) -o $@
57
-
58
-$(BIN)/__umoddi3.o:	arch/ia64/core/idiv64.S
59
-	$(CPP) $(CFLAGS) -DASSEMBLY -DUNSIGNED -DMODULO $< | $(AS) $(ASFLAGS) -o $@
60
-
61
-$(BIN)/__divsi3.o:	arch/ia64/core/idiv32.S
62
-	$(CPP) $(CFLAGS) -DASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
63
-
64
-$(BIN)/__udivsi3.o:	arch/ia64/core/idiv32.S
65
-	$(CPP) $(CFLAGS) -DASSEMBLY -DUNSIGNED $< | $(AS) $(ASFLAGS) -o $@
66
-
67
-$(BIN)/__modsi3.o:	arch/ia64/core/idiv32.S
68
-	$(CPP) $(CFLAGS) -DASSEMBLY -DMODULO $< | $(AS) $(ASFLAGS) -o $@
69
-
70
-$(BIN)/__umodsi3.o:	arch/ia64/core/idiv32.S
71
-	$(CPP) $(CFLAGS) -DASSEMBLY -DUNSIGNED -DMODULO $< | $(AS) $(ASFLAGS) -o $@
72
-
73
-
74
-
75
-# Utilities
76
-$(BIN)/nrv2b:	util/nrv2b.c
77
-	$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=64 -DENDIAN=0 -o $@ $<
78
-
79
-# Pattern Rules
80
-
81
-# General for compiling assembly source files
82
-$(BIN)/%.o:	arch/ia64/core/%.c $(MAKEDEPS)
83
-	$(CC) $(CFLAGS) -o $@ -c $<
84
-
85
-$(BIN)/%.o:	arch/ia64/prefix/%.S $(MAKEDEPS)
86
-	$(CPP) $(CFLAGS) -DASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
87
-
88
-$(BIN)/%.o:	arch/ia64/core/%.S $(MAKEDEPS)
89
-	$(CPP) $(CFLAGS) -DASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
90
-
91
-$(BIN)/%.o:	$(BIN)/%.s
92
-	$(AS)	$(ASFLAGS) -o $@ $<
93
-
94
-# General rules for bootable images
95
-
96
-# Rules for nrv2b compressed images
97
-$(BIN)/unnrv2b.tmp:	$(BIN)/unnrv2b.o arch/ia64/prefix/unnrv2b.lds $(MAKEDEPS)
98
-	$(LD) -T arch/ia64/prefix/unnrv2b.lds $< -o $@
99
-
100
-$(BIN)/unnrv2b: $(BIN)/unnrv2b.tmp $(MAKEDEPS)
101
-	$(OBJCOPY) -O binary $< $@
102
-
103
-$(BIN)/%.zimg: $(BIN)/%.z $(BIN)/unnrv2b arch/ia64/prefix/apply_unnrv2b_prefix.pl $(MAKEDEPS)
104
-	$(PERL) arch/ia64/prefix/apply_unnrv2b_prefix.pl $(BIN)/unnrv2b $< > $@
105
-
106
-# Placeholder; add no extra symbols to %.sym
107
-$(BIN)/%.zsym: $(BIN)/%.sym $(MAKEDEPS)
108
-	cp -f $< $@
109
-
110
-# rules to generate efi loadable image
111
-SUFFIXES += efi zefi
112
-$(BIN)/efi_prefix.tmp:	$(BIN)/efi_prefix.o arch/ia64/prefix/efi_prefix.lds $(MAKEDEPS)
113
-	$(LD) -T arch/ia64/prefix/efi_prefix.lds $< -o $@
114
-
115
-$(BIN)/efi_prefix: $(BIN)/efi_prefix.tmp  $(MAKEDEPS)
116
-	$(OBJCOPY) -O binary $< $@
117
-
118
-$(BIN)/%.efi:	$(BIN)/%.img $(BIN)/%.tmp $(BIN)/efi_prefix arch/ia64/prefix/apply_efi_prefix.pl $(MAKEDEPS)
119
-	@$(SIZE) $(BIN)/$(*).tmp | (read l1; read d1 d2 bss rest ; echo $$bss )
120
-	$(PERL)	arch/ia64/prefix/apply_efi_prefix.pl $(BIN)/efi_prefix $< `$(SIZE) $(BIN)/$(*).tmp | (read l1; read d1 d2 bss rest ; echo $$bss )` > $@
121
-
122
-$(BIN)/%.zefi: $(BIN)/%.zimg $(BIN)/%.tmp $(BIN)/efi_prefix arch/ia64/prefix/apply_efi_prefix.pl $(MAKEDEPS)
123
-	@$(SIZE) $(BIN)/$(*).tmp | (read l1; read d1 d2 d3 size rest ; echo $$size )
124
-	$(PERL)	arch/ia64/prefix/apply_efi_prefix.pl $(BIN)/efi_prefix $< `$(SIZE) $(BIN)/$(*).tmp | (read l1; read d1 d2 d3 size rest ; echo $$size )` > $@
125
-

+ 0
- 68
src/arch/ia64/core/__call.S View File

@@ -1,68 +0,0 @@
1
-	/* Trampoline for calling outside of etherboot */
2
-
3
-	.text
4
-	.globl	__call
5
-	.proc	__call
6
-__call:
7
-	alloc	loc0=ar.pfs,8,3,8,0 /* in, local, out, rotating */
8
-	mov	loc1=rp
9
-	mov	loc2=gp
10
-	ld8	r14=[in0],8
11
-	;; 
12
-	ld8	gp=[in0]
13
-	mov	r28=in1		/* So we can use stacked pal calling conventions */
14
-	mov	out0=in1
15
-	mov	out1=in2
16
-	mov	out2=in3
17
-	mov	out3=in4
18
-	mov	out4=in5
19
-	mov	out5=in6
20
-	mov	out6=in7
21
-	mov	out7=0		/* So we can work with sal calling conventions */
22
-	
23
-	mov	b6=r14
24
-	;;
25
-	br.call.sptk.few rp=b6
26
-	;;
27
-	rsm			psr.i	/* disable interrupts */
28
-	;; 
29
-	mov	gp=loc2
30
-	mov	rp=loc1
31
-	;; 
32
-	mov	ar.pfs=loc0
33
-	br.ret.sptk.many rp
34
-	
35
-	.size __call, . - __call
36
-	.endp __call
37
-
38
-
39
-	.text
40
-	.globl	pal_call
41
-	.proc	pal_call
42
-pal_call:
43
-	alloc	loc0 = ar.pfs,4,3,0,0 /* in, local, out, rotating */
44
-	mov	loc1 = rp
45
-	mov	loc2 = gp
46
-	add	r8 = @gprel(pal_entry),gp
47
-	add	r9 = @gprel(pal_ret),gp
48
-	;;
49
-	ld8	r14 = [r8]
50
-	;; 
51
-	mov	r28 = in0
52
-	mov	r29 = in1
53
-	mov	r30 = in2
54
-	mov	r31 = in3
55
-	mov	b6 = r14
56
-	mov	rp = r9
57
-	rsm	psr.i	/* disable interrupts */
58
-	;; 
59
-	br.sptk.few	b6
60
-	;; 
61
-pal_ret:
62
-	rsm	psr.i	/* disable interrupts */
63
-	;;
64
-	mov	gp=loc2
65
-	mov	rp=loc1
66
-	;;
67
-	mov	ar.pfs=loc0
68
-	br.ret.sptk.many rp

+ 0
- 1026
src/arch/ia64/core/efi.c
File diff suppressed because it is too large
View File


+ 0
- 82
src/arch/ia64/core/etherboot.lds View File

@@ -1,82 +0,0 @@
1
-OUTPUT_FORMAT("elf64-ia64-little")
2
-
3
-OUTPUT_ARCH(ia64)
4
-
5
-ENTRY(_start)
6
-SECTIONS {
7
-	. = 0;
8
-	__gp = . + 0x200000;
9
-	_virt_start = .;
10
-	_text = . ;
11
-	.text : {
12
-		/* Start address of etherboot in the virtual address space */
13
-		*(.text)
14
-		*(.text.*)
15
-		_etext = . ;
16
-
17
-		_rodata = . ;
18
-		. = ALIGN(16);
19
-		*(.rodata)
20
-		*(.rodata.*)
21
-		*(.srodata)
22
-		. = ALIGN(16);
23
-		pci_drivers = . ;
24
-		*(.drivers.pci);
25
-		pci_drivers_end = . ;
26
-		. = ALIGN(16);
27
-		isa_drivers = . ;
28
-		*(.drivers.isa);
29
-		isa_drivers_end = . ;
30
-		. = ALIGN(16);
31
-
32
-		. = ALIGN(16);
33
-		_rela = . ;
34
-		*(.rela.text)
35
-		*(.rela.rodata)
36
-		*(.rela.drivers.pci)
37
-		*(.rela.drivers.isa)
38
-		*(.rela.drivers.efi)
39
-		*(.rela.data)
40
-		*(.rela.sdata)
41
-		*(.rela.got)
42
-		_erela = . ;
43
-		. = ALIGN(16);
44
-		_erodata = . ;
45
-	}
46
-	_rela_size = _erela - _rela ; 
47
-	.data : {
48
-		_data = . ;
49
-		*(.data)
50
-		*(.got.plt)
51
-		*(.got)
52
-		*(.sdata)
53
-		*(.sbss)
54
-		*(.scommon)
55
-		*(.data.*)
56
-		*(.data1)
57
-		. = ALIGN(16);
58
-		_edata = . ;
59
-	}
60
-	_bss = . ;
61
-	.bss : {
62
-		*(.sbss)
63
-		*(.scommon)
64
-		*(.dynbss)
65
-		*(.bss)
66
-		*(COMMON)
67
-	}
68
-	_ebss = .;
69
-	_end = .;
70
-	/DISCARD/ : {
71
-		*(.comment)
72
-		*(.note)
73
-		*(.hash)
74
-		*(.dynstr)
75
-		*(.dynsym)
76
-		*(.IA_64.unwind)
77
-		*(.IA_64.unwind_info)
78
-		*(.IA64_unwind)
79
-		*(.IA64_unwind_info)
80
-		*(.dynamic)
81
-	}
82
-}

+ 0
- 92
src/arch/ia64/core/ia64_timer.c View File

@@ -1,92 +0,0 @@
1
-#include "etherboot.h"
2
-#include "timer.h"
3
-#include "sal.h"
4
-#include "pal.h"
5
-#include "init.h"
6
-
7
-static inline unsigned long get_cycles(void)
8
-{
9
-	unsigned long result;
10
-	__asm__ __volatile__(";;mov %0=ar.itc;;" : "=r"(result));
11
-	return result;
12
-}
13
-
14
-/* ------ Calibrate the TSC ------- 
15
- * Time how long it takes to excute a loop that runs in known time.
16
- * And find the convertion needed to get to CLOCK_TICK_RATE
17
- */
18
-
19
-static unsigned long calibrate_cycles(void)
20
-{
21
-	unsigned long platform_ticks_per_second, drift_info;
22
-	struct pal_freq_ratio itc_ratio;
23
-	long result;
24
-	result = sal_freq_base(SAL_FREQ_BASE_PLATFORM, &platform_ticks_per_second, &drift_info);
25
-	if (result != 0) {
26
-		printf("sal_freq_base failed: %lx\n",result);
27
-		exit(1);
28
-	} else {
29
-		result = pal_freq_ratios(0,0,&itc_ratio);
30
-		if (result != 0) {
31
-			printf("pal_freq_ratios failed: %lx\n", result);
32
-			exit(1);
33
-		}
34
-	}
35
-	/* Avoid division by zero */
36
-	if (itc_ratio.den == 0)
37
-		itc_ratio.den = 1;
38
-
39
-	return (platform_ticks_per_second *itc_ratio.num)/(itc_ratio.den*TICKS_PER_SEC);
40
-}
41
-
42
-static unsigned long clocks_per_tick;
43
-static void setup_timers(void)
44
-{
45
-	if (!clocks_per_tick) {
46
-		clocks_per_tick = calibrate_cycles();
47
-		/* Display the CPU Mhz to easily test if the calibration was bad */
48
-		printf("ITC %ld Mhz\n", (clocks_per_tick/1000 * TICKS_PER_SEC)/1000);
49
-	}
50
-}
51
-
52
-unsigned long currticks(void)
53
-{
54
-	return get_cycles()/clocks_per_tick;
55
-}
56
-
57
-static unsigned long timer_timeout;
58
-static int __timer_running(void)
59
-{
60
-	return get_cycles() < timer_timeout;
61
-}
62
-
63
-void udelay(unsigned int usecs)
64
-{
65
-	unsigned long now;
66
-	now = get_cycles();
67
-	timer_timeout = now + usecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000));
68
-	while(__timer_running());
69
-}
70
-void ndelay(unsigned int nsecs)
71
-{
72
-	unsigned long now;
73
-	now = get_cycles();
74
-	timer_timeout = now + nsecs * ((clocks_per_tick * TICKS_PER_SEC)/(1000*1000*1000));
75
-	while(__timer_running());
76
-}
77
-
78
-void load_timer2(unsigned int timer2_ticks)
79
-{
80
-	unsigned long now;
81
-	unsigned long clocks;
82
-	now = get_cycles();
83
-	clocks = timer2_ticks * ((clocks_per_tick * TICKS_PER_SEC)/CLOCK_TICK_RATE);
84
-	timer_timeout = now + clocks;
85
-}
86
-
87
-int timer2_running(void)
88
-{
89
-	return __timer_running();
90
-}
91
-
92
-INIT_FN ( INIT_TIMERS, setup_timers, NULL, NULL );

+ 0
- 86
src/arch/ia64/core/idiv32.S View File

@@ -1,86 +0,0 @@
1
-/*
2
- * Copyright (C) 2000 Hewlett-Packard Co
3
- * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
4
- *
5
- * 32-bit integer division.
6
- *
7
- * This code is based on the application note entitled "Divide, Square Root
8
- * and Remainder Algorithms for the IA-64 Architecture".  This document
9
- * is available as Intel document number 248725-002 or via the web at
10
- * http://developer.intel.com/software/opensource/numerics/
11
- *
12
- * For more details on the theory behind these algorithms, see "IA-64
13
- * and Elementary Functions" by Peter Markstein; HP Professional Books
14
- * (http://www.hp.com/go/retailbooks/)
15
- */
16
-
17
-#ifdef MODULO
18
-# define OP	mod
19
-#else
20
-# define OP	div
21
-#endif
22
-
23
-#ifdef UNSIGNED
24
-# define SGN	u
25
-# define EXTEND	zxt4
26
-# define INT_TO_FP(a,b)	fcvt.xuf.s1 a=b
27
-# define FP_TO_INT(a,b)	fcvt.fxu.trunc.s1 a=b
28
-#else
29
-# define SGN
30
-# define EXTEND	sxt4
31
-# define INT_TO_FP(a,b)	fcvt.xf a=b
32
-# define FP_TO_INT(a,b)	fcvt.fx.trunc.s1 a=b
33
-#endif
34
-
35
-#define PASTE1(a,b)	a##b
36
-#define PASTE(a,b)	PASTE1(a,b)
37
-#define NAME		PASTE(PASTE(__,SGN),PASTE(OP,si3))
38
-
39
-	.text
40
-	.global NAME
41
-	.proc NAME
42
-NAME :	
43
-	.regstk 2,0,0,0
44
-	// Transfer inputs to FP registers.
45
-	mov r2 = 0xffdd			// r2 = -34 + 65535 (fp reg format bias)
46
-	EXTEND in0 = in0		// in0 = a
47
-	EXTEND in1 = in1		// in1 = b
48
-	;;
49
-	setf.sig f8 = in0
50
-	setf.sig f9 = in1
51
-#ifdef MODULO
52
-	sub in1 = r0, in1		// in1 = -b
53
-#endif
54
-	;;
55
-	// Convert the inputs to FP, to avoid FP software-assist faults.
56
-	INT_TO_FP(f8, f8)
57
-	INT_TO_FP(f9, f9)
58
-	;;
59
-	setf.exp f7 = r2		// f7 = 2^-34
60
-	frcpa.s1 f6, p6 = f8, f9	// y0 = frcpa(b)
61
-	;;
62
-(p6)	fmpy.s1 f8 = f8, f6		// q0 = a*y0
63
-(p6)	fnma.s1 f6 = f9, f6, f1		// e0 = -b*y0 + 1 
64
-	;;
65
-#ifdef MODULO
66
-	setf.sig f9 = in1		// f9 = -b
67
-#endif
68
-(p6)	fma.s1 f8 = f6, f8, f8		// q1 = e0*q0 + q0
69
-(p6)	fma.s1 f6 = f6, f6, f7		// e1 = e0*e0 + 2^-34
70
-	;;
71
-#ifdef MODULO
72
-	setf.sig f7 = in0
73
-#endif
74
-(p6)	fma.s1 f6 = f6, f8, f8		// q2 = e1*q1 + q1
75
-	;;
76
-	FP_TO_INT(f6, f6)		// q = trunc(q2)
77
-	;;
78
-#ifdef MODULO
79
-	xma.l f6 = f6, f9, f7		// r = q*(-b) + a
80
-	;;
81
-#endif
82
-	getf.sig r8 = f6		// transfer result to result register
83
-	br.ret.sptk.many rp
84
-
85
-	.size NAME, . - NAME
86
-	.endp NAME

+ 0
- 96
src/arch/ia64/core/idiv64.S View File

@@ -1,96 +0,0 @@
1
-/*
2
- * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
3
- * Copyright (C) 1999-2000 David Mosberger-Tang <davidm@hpl.hp.com>
4
- *
5
- * 64-bit integer division.
6
- *
7
- * This code is based on the application note entitled "Divide, Square Root
8
- * and Remainder Algorithms for the IA-64 Architecture".  This document
9
- * is available as Intel document number 248725-002 or via the web at
10
- * http://developer.intel.com/software/opensource/numerics/
11
- *
12
- * For more details on the theory behind these algorithms, see "IA-64
13
- * and Elementary Functions" by Peter Markstein; HP Professional Books
14
- * (http://www.hp.com/go/retailbooks/)
15
- */
16
-
17
-#ifdef MODULO
18
-# define OP	mod
19
-#else
20
-# define OP	div
21
-#endif
22
-
23
-#ifdef UNSIGNED
24
-# define SGN	u
25
-# define INT_TO_FP(a,b)	fcvt.xuf.s1 a=b
26
-# define FP_TO_INT(a,b)	fcvt.fxu.trunc.s1 a=b
27
-#else
28
-# define SGN
29
-# define INT_TO_FP(a,b)	fcvt.xf a=b
30
-# define FP_TO_INT(a,b)	fcvt.fx.trunc.s1 a=b
31
-#endif
32
-
33
-#define PASTE1(a,b)	a##b
34
-#define PASTE(a,b)	PASTE1(a,b)
35
-#define NAME		PASTE(PASTE(__,SGN),PASTE(OP,di3))
36
-
37
-	.text
38
-	.global NAME
39
-	.proc NAME
40
-NAME :	
41
-	.prologue
42
-	.regstk 2,0,0,0
43
-	// Transfer inputs to FP registers.
44
-	setf.sig f8 = in0
45
-	setf.sig f9 = in1
46
-	;;
47
-	.fframe 16
48
-	.save.f 0x20
49
-	stf.spill [sp] = f17,-16
50
-
51
-	// Convert the inputs to FP, to avoid FP software-assist faults.
52
-	INT_TO_FP(f8, f8)
53
-	;;
54
-
55
-	.save.f 0x10
56
-	stf.spill [sp] = f16
57
-	.body
58
-	INT_TO_FP(f9, f9)
59
-	;;
60
-	frcpa.s1 f17, p6 = f8, f9	// y0 = frcpa(b)
61
-	;;
62
-(p6)	fmpy.s1 f7 = f8, f17		// q0 = a*y0
63
-(p6)	fnma.s1 f6 = f9, f17, f1	// e0 = -b*y0 + 1
64
-	;;
65
-(p6)	fma.s1 f16 = f7, f6, f7		// q1 = q0*e0 + q0
66
-(p6)	fmpy.s1 f7 = f6, f6		// e1 = e0*e0
67
-	;;
68
-#ifdef MODULO
69
-	sub in1 = r0, in1		// in1 = -b
70
-#endif
71
-(p6)	fma.s1 f16 = f16, f7, f16	// q2 = q1*e1 + q1
72
-(p6)	fma.s1 f6 = f17, f6, f17	// y1 = y0*e0 + y0
73
-	;;
74
-(p6)	fma.s1 f6 = f6, f7, f6		// y2 = y1*e1 + y1
75
-(p6)	fnma.s1 f7 = f9, f16, f8	// r = -b*q2 + a
76
-	;;
77
-#ifdef MODULO
78
-	setf.sig f8 = in0		// f8 = a
79
-	setf.sig f9 = in1		// f9 = -b
80
-#endif
81
-(p6)	fma.s1 f17 = f7, f6, f16	// q3 = r*y2 + q2
82
-	;;
83
-	.restore sp
84
-	ldf.fill f16 = [sp], 16
85
-	FP_TO_INT(f17, f17)		// q = trunc(q3)
86
-	;;
87
-#ifdef MODULO
88
-	xma.l f17 = f17, f9, f8		// r = q*(-b) + a
89
-	;;
90
-#endif
91
-	getf.sig r8 = f17		// transfer result to result register
92
-	ldf.fill f17 = [sp]
93
-	br.ret.sptk.many rp
94
-	
95
-	.size NAME, . - NAME
96
-	.endp NAME

+ 0
- 163
src/arch/ia64/core/longjmp.S View File

@@ -1,163 +0,0 @@
1
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
2
-   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
3
-
4
-   The GNU C Library is free software; you can redistribute it and/or
5
-   modify it under the terms of the GNU Lesser General Public
6
-   License as published by the Free Software Foundation; either
7
-   version 2.1 of the License, or (at your option) any later version.
8
-
9
-   The GNU C Library is distributed in the hope that it will be useful,
10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
-   Lesser General Public License for more details.
13
-
14
-   You should have received a copy of the GNU Lesser General Public
15
-   License along with the GNU C Library; if not, write to the Free
16
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
-   02111-1307 USA.
18
-
19
-   Note that __sigsetjmp() did NOT flush the register stack.  Instead,
20
-   we do it here since __longjmp() is usually much less frequently
21
-   invoked than __sigsetjmp(). The only difficulty is that __sigsetjmp()
22
-   didn't (and wouldn't be able to) save ar.rnat either.  This is a problem
23
-   because if we're not careful, we could end up loading random NaT bits.
24
-   There are two cases:
25
-
26
-	(i)  ar.bsp < ia64_rse_rnat_addr(jmpbuf.ar_bsp)
27
-		ar.rnat contains the desired bits---preserve ar.rnat
28
-		across loadrs and write to ar.bspstore
29
-
30
-	(ii) ar.bsp >= ia64_rse_rnat_addr(jmpbuf.ar_bsp)
31
-		The desired ar.rnat is stored in
32
-		ia64_rse_rnat_addr(jmpbuf.ar_bsp).  Load those
33
-		bits into ar.rnat after setting ar.bspstore. */
34
-
35
-
36
-#	define	pPos	p6	/* is rotate count positive? */
37
-#	define	pNeg	p7	/* is rotate count negative? */
38
-
39
-
40
-	/* longjmp(__jmp_buf buf, int val) */
41
-
42
-	.text
43
-	.global longjmp
44
-	.proc longjmp
45
-longjmp:	
46
-
47
-	alloc r8=ar.pfs,2,1,0,0
48
-	mov r27=ar.rsc
49
-	add r2=0x98,in0		// r2 <- &jmpbuf.orig_jmp_buf_addr
50
-	;;
51
-	ld8 r8=[r2],-16		// r8 <- orig_jmp_buf_addr
52
-	mov r10=ar.bsp
53
-	and r11=~0x3,r27	// clear ar.rsc.mode
54
-	;;
55
-	flushrs			// flush dirty regs to backing store (must be first in insn grp)
56
-	ld8 r23=[r2],8		// r23 <- jmpbuf.ar_bsp
57
-	sub r8=r8,in0		// r8 <- &orig_jmpbuf - &jmpbuf
58
-	;;
59
-	ld8 r25=[r2]		// r25 <- jmpbuf.ar_unat
60
-	extr.u r8=r8,3,6	// r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f
61
-	;;
62
-	cmp.lt pNeg,pPos=r8,r0
63
-	mov r2=in0
64
-	;;
65
-(pPos)	mov r16=r8
66
-(pNeg)	add r16=64,r8
67
-(pPos)	sub r17=64,r8
68
-(pNeg)	sub r17=r0,r8
69
-	;;
70
-	mov ar.rsc=r11		// put RSE in enforced lazy mode
71
-	shr.u r8=r25,r16
72
-	add r3=8,in0		// r3 <- &jmpbuf.r1
73
-	shl r9=r25,r17
74
-	;;
75
-	or r25=r8,r9
76
-	;;
77
-	mov r26=ar.rnat
78
-	mov ar.unat=r25		// setup ar.unat (NaT bits for r1, r4-r7, and r12)
79
-	;;
80
-	ld8.fill.nta sp=[r2],16	// r12 (sp)
81
-	ld8.fill.nta gp=[r3],16		// r1 (gp)
82
-	dep r11=-1,r23,3,6	// r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp)
83
-	;;
84
-	ld8.nta r16=[r2],16		// caller's unat
85
-	ld8.nta r17=[r3],16		// fpsr
86
-	;;
87
-	ld8.fill.nta r4=[r2],16	// r4
88
-	ld8.fill.nta r5=[r3],16		// r5 (gp)
89
-	cmp.geu p8,p0=r10,r11	// p8 <- (ar.bsp >= jmpbuf.ar_bsp)
90
-	;;
91
-	ld8.fill.nta r6=[r2],16	// r6
92
-	ld8.fill.nta r7=[r3],16		// r7
93
-	;;
94
-	mov ar.unat=r16			// restore caller's unat
95
-	mov ar.fpsr=r17			// restore fpsr
96
-	;;
97
-	ld8.nta r16=[r2],16		// b0
98
-	ld8.nta r17=[r3],16		// b1
99
-	;;
100
-(p8)	ld8 r26=[r11]		// r26 <- *ia64_rse_rnat_addr(jmpbuf.ar_bsp)
101
-	mov ar.bspstore=r23	// restore ar.bspstore
102
-	;;
103
-	ld8.nta r18=[r2],16		// b2
104
-	ld8.nta r19=[r3],16		// b3
105
-	;;
106
-	ld8.nta r20=[r2],16		// b4
107
-	ld8.nta r21=[r3],16		// b5
108
-	;;
109
-	ld8.nta r11=[r2],16		// ar.pfs
110
-	ld8.nta r22=[r3],56		// ar.lc
111
-	;;
112
-	ld8.nta r24=[r2],32		// pr
113
-	mov b0=r16
114
-	;;
115
-	ldf.fill.nta f2=[r2],32
116
-	ldf.fill.nta f3=[r3],32
117
-	mov b1=r17
118
-	;;
119
-	ldf.fill.nta f4=[r2],32
120
-	ldf.fill.nta f5=[r3],32
121
-	mov b2=r18
122
-	;;
123
-	ldf.fill.nta f16=[r2],32
124
-	ldf.fill.nta f17=[r3],32
125
-	mov b3=r19
126
-	;;
127
-	ldf.fill.nta f18=[r2],32
128
-	ldf.fill.nta f19=[r3],32
129
-	mov b4=r20
130
-	;;
131
-	ldf.fill.nta f20=[r2],32
132
-	ldf.fill.nta f21=[r3],32
133
-	mov b5=r21
134
-	;;
135
-	ldf.fill.nta f22=[r2],32
136
-	ldf.fill.nta f23=[r3],32
137
-	mov ar.lc=r22
138
-	;;
139
-	ldf.fill.nta f24=[r2],32
140
-	ldf.fill.nta f25=[r3],32
141
-	cmp.eq p8,p9=0,in1
142
-	;;
143
-	ldf.fill.nta f26=[r2],32
144
-	ldf.fill.nta f27=[r3],32
145
-	mov ar.pfs=r11
146
-	;;
147
-	ldf.fill.nta f28=[r2],32
148
-	ldf.fill.nta f29=[r3],32
149
-	;;
150
-	ldf.fill.nta f30=[r2]
151
-	ldf.fill.nta f31=[r3]
152
-(p8)	mov r8=1
153
-
154
-	mov ar.rnat=r26		// restore ar.rnat
155
-	;;
156
-	mov ar.rsc=r27		// restore ar.rsc
157
-(p9)	mov r8=in1
158
-
159
-	invala			// virt. -> phys. regnum mapping may change
160
-	mov pr=r24,-1
161
-	br.ret.sptk.few b0
162
-	.size longjmp, . - longjmp
163
-	.endp longjmp

+ 0
- 244
src/arch/ia64/core/memmove.S View File

@@ -1,244 +0,0 @@
1
-/* Optimized version of the standard memmove() function.
2
-   This file is part of the GNU C Library.
3
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
4
-   Contributed by Dan Pop <Dan.Pop@cern.ch>.
5
-
6
-   The GNU C Library is free software; you can redistribute it and/or
7
-   modify it under the terms of the GNU Lesser General Public
8
-   License as published by the Free Software Foundation; either
9
-   version 2.1 of the License, or (at your option) any later version.
10
-
11
-   The GNU C Library is distributed in the hope that it will be useful,
12
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
-   Lesser General Public License for more details.
15
-
16
-   You should have received a copy of the GNU Lesser General Public
17
-   License along with the GNU C Library; if not, write to the Free
18
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
-   02111-1307 USA.  */
20
-
21
-/* Return: dest
22
-
23
-   Inputs:
24
-        in0:    dest
25
-        in1:    src
26
-        in2:    byte count
27
-
28
-   The core of the function is the memcpy implementation used in memcpy.S.
29
-   When bytes have to be copied backwards, only the easy case, when
30
-   all arguments are multiples of 8, is optimised.
31
-
32
-   In this form, it assumes little endian mode.  For big endian mode,
33
-   sh1 must be computed using an extra instruction: sub sh1 = 64, sh1
34
-   or the UM.be bit should be cleared at the beginning and set at the end.  */
35
-
36
-
37
-#define OP_T_THRES 	16
38
-#define OPSIZ 		 8
39
-
40
-#define adest		r15
41
-#define saved_pr	r17
42
-#define saved_lc	r18
43
-#define dest		r19
44
-#define src		r20
45
-#define len		r21
46
-#define asrc		r22
47
-#define tmp2		r23
48
-#define tmp3		r24
49
-#define	tmp4		r25
50
-#define ptable		r26
51
-#define ploop56		r27
52
-#define	loopaddr	r28
53
-#define	sh1		r29
54
-#define loopcnt		r30
55
-#define	value		r31
56
-
57
-#define LOOP(shift)							\
58
-		.align	32 ;						\
59
-.loop##shift##:								\
60
-(p[0])		ld8	r[0] = [asrc], 8 ;	/* w1 */		\
61
-(p[MEMLAT+1])	st8	[dest] = value, 8 ;				\
62
-(p[MEMLAT])	shrp	value = r[MEMLAT], r[MEMLAT+1], shift ;	\
63
-		nop.b	0 ;						\
64
-		nop.b	0 ;						\
65
-		br.ctop.sptk .loop##shift ;				\
66
-		br.cond.sptk .cpyfew ; /* deal with the remaining bytes */
67
-
68
-#define MEMLAT	21
69
-#define Nrot	(((2*MEMLAT+3) + 7) & ~7)
70
-
71
-	.text
72
-	.global memmove, memcpy
73
-	.proc memove
74
-memcpy:	
75
-memmove:	
76
-	.prologue
77
-	alloc 	r2 = ar.pfs, 3, Nrot - 3, 0, Nrot
78
-	.rotr	r[MEMLAT + 2], q[MEMLAT + 1]
79
-	.rotp	p[MEMLAT + 2]
80
-	mov	ret0 = in0		// return value = dest
81
-	.save pr, saved_pr
82
-	mov	saved_pr = pr		// save the predicate registers
83
-	.save ar.lc, saved_lc
84
-        mov 	saved_lc = ar.lc	// save the loop counter
85
-	.body
86
-	or	tmp3 = in0, in1 ;;	// tmp3 = dest | src
87
-	or	tmp3 = tmp3, in2	// tmp3 = dest | src | len
88
-	mov 	dest = in0		// dest
89
-	mov 	src = in1		// src
90
-	mov	len = in2		// len
91
-	sub	tmp2 = r0, in0		// tmp2 = -dest
92
-	cmp.eq	p6, p0 = in2, r0	// if (len == 0)
93
-(p6)	br.cond.spnt .restore_and_exit;;// 	return dest;
94
-	and	tmp4 = 7, tmp3 		// tmp4 = (dest | src | len) & 7
95
-	cmp.le	p6, p0 = dest, src	// if dest <= src it's always safe
96
-(p6)	br.cond.spnt .forward		// to copy forward
97
-	add	tmp3 = src, len;;
98
-	cmp.lt	p6, p0 = dest, tmp3	// if dest > src && dest < src + len
99
-(p6)	br.cond.spnt .backward		// we have to copy backward
100
-
101
-.forward:
102
-	shr.u	loopcnt = len, 4 ;;	// loopcnt = len / 16
103
-	cmp.ne	p6, p0 = tmp4, r0	// if ((dest | src | len) & 7 != 0)
104
-(p6)	br.cond.sptk .next		//	goto next;
105
-
106
-// The optimal case, when dest, src and len are all multiples of 8
107
-
108
-	and	tmp3 = 0xf, len
109
-	mov	pr.rot = 1 << 16	// set rotating predicates
110
-	mov	ar.ec = MEMLAT + 1 ;;	// set the epilog counter
111
-	cmp.ne	p6, p0 = tmp3, r0	// do we have to copy an extra word?
112
-	adds	loopcnt = -1, loopcnt;;	// --loopcnt
113
-(p6)	ld8	value = [src], 8;;
114
-(p6)	st8	[dest] = value, 8	// copy the "odd" word
115
-	mov	ar.lc = loopcnt 	// set the loop counter
116
-	cmp.eq	p6, p0 = 8, len
117
-(p6)	br.cond.spnt .restore_and_exit;;// the one-word special case
118
-	adds	adest = 8, dest		// set adest one word ahead of dest
119
-	adds	asrc = 8, src ;;	// set asrc one word ahead of src
120
-	nop.b	0			// get the "golden" alignment for
121
-	nop.b	0			// the next loop
122
-.l0:
123
-(p[0])		ld8	r[0] = [src], 16
124
-(p[0])		ld8	q[0] = [asrc], 16
125
-(p[MEMLAT])	st8	[dest] = r[MEMLAT], 16
126
-(p[MEMLAT])	st8	[adest] = q[MEMLAT], 16
127
-		br.ctop.dptk .l0 ;;
128
-
129
-	mov	pr = saved_pr, -1	// restore the predicate registers
130
-	mov	ar.lc = saved_lc	// restore the loop counter
131
-	br.ret.sptk.many b0
132
-.next:
133
-	cmp.ge	p6, p0 = OP_T_THRES, len	// is len <= OP_T_THRES
134
-	and	loopcnt = 7, tmp2 		// loopcnt = -dest % 8
135
-(p6)	br.cond.spnt	.cpyfew			// copy byte by byte
136
-	;;
137
-	cmp.eq	p6, p0 = loopcnt, r0
138
-(p6)	br.cond.sptk	.dest_aligned
139
-	sub	len = len, loopcnt	// len -= -dest % 8
140
-	adds	loopcnt = -1, loopcnt	// --loopcnt
141
-	;;
142
-	mov	ar.lc = loopcnt
143
-.l1:					// copy -dest % 8 bytes
144
-	ld1	value = [src], 1	// value = *src++
145
-	;;
146
-	st1	[dest] = value, 1	// *dest++ = value
147
-	br.cloop.dptk .l1
148
-.dest_aligned:
149
-	and	sh1 = 7, src 		// sh1 = src % 8
150
-	and	tmp2 = -8, len   	// tmp2 = len & -OPSIZ
151
-	and	asrc = -8, src		// asrc = src & -OPSIZ  -- align src
152
-	shr.u	loopcnt = len, 3	// loopcnt = len / 8
153
-	and	len = 7, len;;		// len = len % 8
154
-	adds	loopcnt = -1, loopcnt	// --loopcnt
155
-	addl	tmp4 = @ltoff(.table), gp
156
-	addl	tmp3 = @ltoff(.loop56), gp
157
-	mov     ar.ec = MEMLAT + 1	// set EC
158
-	mov     pr.rot = 1 << 16;;	// set rotating predicates
159
-	mov	ar.lc = loopcnt		// set LC
160
-	cmp.eq  p6, p0 = sh1, r0 	// is the src aligned?
161
-(p6)    br.cond.sptk .src_aligned
162
-	add	src = src, tmp2		// src += len & -OPSIZ
163
-	shl	sh1 = sh1, 3		// sh1 = 8 * (src % 8)
164
-	ld8	ploop56 = [tmp3]	// ploop56 = &loop56
165
-	ld8	ptable = [tmp4];;	// ptable = &table
166
-	add	tmp3 = ptable, sh1;;	// tmp3 = &table + sh1
167
-	mov	ar.ec = MEMLAT + 1 + 1 // one more pass needed
168
-	ld8	tmp4 = [tmp3];;		// tmp4 = loop offset
169
-	sub	loopaddr = ploop56,tmp4	// loopadd = &loop56 - loop offset
170
-	ld8	r[1] = [asrc], 8;;	// w0
171
-	mov	b6 = loopaddr;;
172
-	br	b6			// jump to the appropriate loop
173
-
174
-	LOOP(8)
175
-	LOOP(16)
176
-	LOOP(24)
177
-	LOOP(32)
178
-	LOOP(40)
179
-	LOOP(48)
180
-	LOOP(56)
181
-
182
-.src_aligned:
183
-.l3:
184
-(p[0])		ld8	r[0] = [src], 8
185
-(p[MEMLAT])	st8	[dest] = r[MEMLAT], 8
186
-		br.ctop.dptk .l3
187
-.cpyfew:
188
-	cmp.eq	p6, p0 = len, r0	// is len == 0 ?
189
-	adds	len = -1, len		// --len;
190
-(p6)	br.cond.spnt	.restore_and_exit ;;
191
-	mov	ar.lc = len
192
-.l4:
193
-	ld1	value = [src], 1
194
-	;;
195
-	st1	[dest] = value, 1
196
-	br.cloop.dptk	.l4 ;;
197
-.restore_and_exit:
198
-	mov     pr = saved_pr, -1    	// restore the predicate registers
199
-	mov 	ar.lc = saved_lc	// restore the loop counter
200
-	br.ret.sptk.many b0
201
-
202
-// In the case of a backward copy, optimise only the case when everything
203
-// is a multiple of 8, otherwise copy byte by byte.  The backward copy is
204
-// used only when the blocks are overlapping and dest > src.
205
-
206
-.backward:
207
-	shr.u	loopcnt = len, 3	// loopcnt = len / 8
208
-	add	src = src, len		// src points one byte past the end
209
-	add	dest = dest, len ;; 	// dest points one byte past the end
210
-	mov	ar.ec = MEMLAT + 1	// set the epilog counter
211
-	mov	pr.rot = 1 << 16	// set rotating predicates
212
-	adds	loopcnt = -1, loopcnt	// --loopcnt
213
-	cmp.ne	p6, p0 = tmp4, r0	// if ((dest | src | len) & 7 != 0)
214
-(p6)	br.cond.sptk .bytecopy ;;	// copy byte by byte backward
215
-	adds	src = -8, src		// src points to the last word
216
-	adds	dest = -8, dest 	// dest points to the last word
217
-	mov	ar.lc = loopcnt;;	// set the loop counter
218
-.l5:
219
-(p[0])		ld8	r[0] = [src], -8
220
-(p[MEMLAT])	st8	[dest] = r[MEMLAT], -8
221
-		br.ctop.dptk .l5
222
-		br.cond.sptk .restore_and_exit
223
-.bytecopy:
224
-	adds	src = -1, src		// src points to the last byte
225
-	adds	dest = -1, dest		// dest points to the last byte
226
-	adds	loopcnt = -1, len;;	// loopcnt = len - 1
227
-	mov	ar.lc = loopcnt;;	// set the loop counter
228
-.l6:
229
-(p[0])		ld1	r[0] = [src], -1
230
-(p[MEMLAT])	st1	[dest] = r[MEMLAT], -1
231
-		br.ctop.dptk .l6
232
-		br.cond.sptk .restore_and_exit
233
-.table:
234
-	data8	0			// dummy entry
235
-	data8 	.loop56 - .loop8
236
-	data8 	.loop56 - .loop16
237
-	data8 	.loop56 - .loop24
238
-	data8	.loop56 - .loop32
239
-	data8	.loop56 - .loop40
240
-	data8	.loop56 - .loop48
241
-	data8	.loop56 - .loop56
242
-
243
-	.size memmove, . - memove
244
-	.endp memmove

+ 0
- 133
src/arch/ia64/core/memset.S View File

@@ -1,133 +0,0 @@
1
-/*
2
- *  Copyright (C) 1999-2002 Hewlett-Packard Co.
3
- *	Contributed by Stephane Eranian <eranian@hpl.hp.com>
4
- *
5
- * This file is part of the ELILO, the EFI Linux boot loader.
6
- *
7
- *  ELILO is free software; you can redistribute it and/or modify
8
- *  it under the terms of the GNU General Public License as published by
9
- *  the Free Software Foundation; either version 2, or (at your option)
10
- *  any later version.
11
- *
12
- *  ELILO is distributed in the hope that it will be useful,
13
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- *  GNU General Public License for more details.
16
- *
17
- *  You should have received a copy of the GNU General Public License
18
- *  along with ELILO; see the file COPYING.  If not, write to the Free
19
- *  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20
- *  02111-1307, USA.
21
- *
22
- * Please check out the elilo.txt for complete documentation on how
23
- * to use this program.
24
- *
25
- * This code is derived from the Linux/ia64 source code.
26
- */
27
-
28
-/*
29
- *
30
- * Optimized version of the standard memset() function
31
- *
32
- * Return: none
33
- *
34
- * Inputs:
35
- *	in0:	address of buffer
36
- * 	in1:	byte value to use for storing
37
- *	in2:	length of the buffer
38
- *
39
- */
40
-
41
-// arguments
42
-//
43
-#define buf		r32
44
-#define val		r33
45
-#define len		r34
46
-
47
-//
48
-// local registers
49
-//
50
-#define saved_pfs	r14
51
-#define cnt		r18
52
-#define buf2		r19
53
-#define saved_lc	r20
54
-#define tmp		r21
55
-	.text
56
-	.global memset
57
-	.proc memset
58
-memset:
59
-	.prologue
60
-	.save ar.pfs, saved_pfs
61
- 	alloc saved_pfs=ar.pfs,3,0,0,0	// cnt is sink here
62
-	cmp.eq p8,p0=r0,len	// check for zero length
63
-	.save ar.lc, saved_lc
64
-	mov saved_lc=ar.lc	// preserve ar.lc (slow)
65
-	;;
66
-
67
-	.body
68
-
69
-	adds tmp=-1,len		// br.ctop is repeat/until
70
-	tbit.nz p6,p0=buf,0	// odd alignment
71
-(p8)	br.ret.spnt.few rp
72
-
73
-	cmp.lt p7,p0=16,len	// if len > 16 then long memset
74
-	mux1 val=val,@brcst	// prepare value
75
-(p7)	br.cond.dptk.few long_memset
76
-	;;
77
-	mov ar.lc=tmp		// initialize lc for small count
78
-	;;			// avoid RAW and WAW on ar.lc
79
-1:				// worst case 15 cyles, avg 8 cycles
80
-	st1 [buf]=val,1
81
-	br.cloop.dptk.few 1b
82
-	;;				// avoid RAW on ar.lc
83
-	mov ar.lc=saved_lc
84
-	mov ar.pfs=saved_pfs
85
-	br.ret.sptk.few rp	// end of short memset
86
-
87
-	// at this point we know we have more than 16 bytes to copy
88
-	// so we focus on alignment
89
-long_memset:
90
-(p6)	st1 [buf]=val,1		// 1-byte aligned
91
-(p6)	adds len=-1,len;;	// sync because buf is modified
92
-	tbit.nz p6,p0=buf,1
93
-	;;
94
-(p6)	st2 [buf]=val,2		// 2-byte aligned
95
-(p6)	adds len=-2,len;;
96
-	tbit.nz p6,p0=buf,2
97
-	;;
98
-(p6)	st4 [buf]=val,4		// 4-byte aligned
99
-(p6)	adds len=-4,len;;
100
-	tbit.nz p6,p0=buf,3
101
-	;;
102
-(p6)	st8 [buf]=val,8		// 8-byte aligned
103
-(p6)	adds len=-8,len;;
104
-	shr.u cnt=len,4		// number of 128-bit (2x64bit) words
105
-	;;
106
-	cmp.eq p6,p0=r0,cnt
107
-	adds tmp=-1,cnt
108
-(p6)	br.cond.dpnt.few .dotail // we have less than 16 bytes left
109
-	;;
110
-	adds buf2=8,buf		// setup second base pointer
111
-	mov ar.lc=tmp
112
-	;;
113
-2:				// 16bytes/iteration
114
-	st8 [buf]=val,16
115
-	st8 [buf2]=val,16
116
-	br.cloop.dptk.few 2b
117
-	;;
118
-.dotail:			// tail correction based on len only
119
-	tbit.nz p6,p0=len,3
120
-	;;
121
-(p6)	st8 [buf]=val,8		// at least 8 bytes
122
-	tbit.nz p6,p0=len,2
123
-	;;
124
-(p6)	st4 [buf]=val,4		// at least 4 bytes
125
-	tbit.nz p6,p0=len,1
126
-	;;
127
-(p6)	st2 [buf]=val,2		// at least 2 bytes
128
-	tbit.nz p6,p0=len,0
129
-	mov ar.lc=saved_lc
130
-	;;
131
-(p6)	st1 [buf]=val		// only 1 byte left
132
-	br.ret.dptk.few rp
133
-	.endp memset

+ 0
- 84
src/arch/ia64/core/pal.c View File

@@ -1,84 +0,0 @@
1
-#include "etherboot.h"
2
-#include "sal.h"
3
-#include "pal.h"
4
-
5
-struct fptr pal_entry;
6
-/*
7
- * Note that some of these calls use a static-register only calling
8
- * convention which has nothing to do with the regular calling
9
- * convention.
10
- */
11
-#define PAL_CACHE_FLUSH		1	/* flush i/d cache */
12
-#define PAL_CACHE_INFO		2	/* get detailed i/d cache info */
13
-#define PAL_CACHE_INIT		3	/* initialize i/d cache */
14
-#define PAL_CACHE_SUMMARY	4	/* get summary of cache heirarchy */
15
-#define PAL_MEM_ATTRIB		5	/* list supported memory attributes */
16
-#define PAL_PTCE_INFO		6	/* purge TLB info */
17
-#define PAL_VM_INFO		7	/* return supported virtual memory features */
18
-#define PAL_VM_SUMMARY		8	/* return summary on supported vm features */
19
-#define PAL_BUS_GET_FEATURES	9	/* return processor bus interface features settings */
20
-#define PAL_BUS_SET_FEATURES	10	/* set processor bus features */
21
-#define PAL_DEBUG_INFO		11	/* get number of debug registers */
22
-#define PAL_FIXED_ADDR		12	/* get fixed component of processors's directed address */
23
-#define PAL_FREQ_BASE		13	/* base frequency of the platform */
24
-#define PAL_FREQ_RATIOS		14	/* ratio of processor, bus and ITC frequency */
25
-#define PAL_PERF_MON_INFO	15	/* return performance monitor info */
26
-#define PAL_PLATFORM_ADDR	16	/* set processor interrupt block and IO port space addr */
27
-#define PAL_PROC_GET_FEATURES	17	/* get configurable processor features & settings */
28
-#define PAL_PROC_SET_FEATURES	18	/* enable/disable configurable processor features */
29
-#define PAL_RSE_INFO		19	/* return rse information */
30
-#define PAL_VERSION		20	/* return version of PAL code */
31
-#define PAL_MC_CLEAR_LOG	21	/* clear all processor log info */
32
-#define PAL_MC_DRAIN		22	/* drain operations which could result in an MCA */
33
-#define PAL_MC_EXPECTED		23	/* set/reset expected MCA indicator */
34
-#define PAL_MC_DYNAMIC_STATE	24	/* get processor dynamic state */
35
-#define PAL_MC_ERROR_INFO	25	/* get processor MCA info and static state */
36
-#define PAL_MC_RESUME		26	/* Return to interrupted process */
37
-#define PAL_MC_REGISTER_MEM	27	/* Register memory for PAL to use during MCAs and inits */
38
-#define PAL_HALT		28	/* enter the low power HALT state */
39
-#define PAL_HALT_LIGHT		29	/* enter the low power light halt state*/
40
-#define PAL_COPY_INFO		30	/* returns info needed to relocate PAL */
41
-#define PAL_CACHE_LINE_INIT	31	/* init tags & data of cache line */
42
-#define PAL_PMI_ENTRYPOINT	32	/* register PMI memory entry points with the processor */
43
-#define PAL_ENTER_IA_32_ENV	33	/* enter IA-32 system environment */
44
-#define PAL_VM_PAGE_SIZE	34	/* return vm TC and page walker page sizes */
45
-
46
-#define PAL_MEM_FOR_TEST	37	/* get amount of memory needed for late processor test */
47
-#define PAL_CACHE_PROT_INFO	38	/* get i/d cache protection info */
48
-#define PAL_REGISTER_INFO	39	/* return AR and CR register information*/
49
-#define PAL_SHUTDOWN		40	/* enter processor shutdown state */
50
-#define PAL_PREFETCH_VISIBILITY	41
51
-
52
-#define PAL_COPY_PAL		256	/* relocate PAL procedures and PAL PMI */
53
-#define PAL_HALT_INFO		257	/* return the low power capabilities of processor */
54
-#define PAL_TEST_PROC		258	/* perform late processor self-test */
55
-#define PAL_CACHE_READ		259	/* read tag & data of cacheline for diagnostic testing */
56
-#define PAL_CACHE_WRITE		260	/* write tag & data of cacheline for diagnostic testing */
57
-#define PAL_VM_TR_READ		261	/* read contents of translation register */
58
-
59
-
60
-/*
61
- * Get the ratios for processor frequency, bus frequency and interval timer to
62
- * to base frequency of the platform
63
- */
64
-long pal_freq_ratios(struct pal_freq_ratio *proc_ratio, 
65
-	struct pal_freq_ratio *bus_ratio, struct pal_freq_ratio *itc_ratio)
66
-{
67
-	struct freq_ratios {
68
-		long status;
69
-		struct pal_freq_ratio proc_ratio;
70
-		struct pal_freq_ratio bus_ratio;
71
-		struct pal_freq_ratio itc_ratio;
72
-	};
73
-	struct freq_ratios result;
74
-	extern struct freq_ratios pal_call(unsigned long which, ...);
75
-	result = pal_call(PAL_FREQ_RATIOS, 0, 0, 0);
76
-	if (proc_ratio)
77
-		*proc_ratio = result.proc_ratio;
78
-	if (bus_ratio)
79
-		*bus_ratio = result.bus_ratio;
80
-	if (itc_ratio)
81
-		*itc_ratio = result.itc_ratio;
82
-	return result.status;
83
-	
84
-}

+ 0
- 62
src/arch/ia64/core/pci_io.c View File

@@ -1,62 +0,0 @@
1
-#include "etherboot.h"
2
-#include "pci.h"
3
-#include "sal.h"
4
-
5
-int pcibios_read_config_byte(unsigned int bus, unsigned int devfn, unsigned int reg, uint8_t *rvalue)
6
-{
7
-	unsigned long value;
8
-	long result;
9
-	result = sal_pci_config_read(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 1, &value);
10
-	*rvalue = value;
11
-	return result;
12
-}
13
-int pcibios_read_config_word(unsigned int bus, unsigned int devfn, unsigned int reg, uint16_t *rvalue)
14
-{
15
-	unsigned long value;
16
-	long result;
17
-	result = sal_pci_config_read(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 2, &value);
18
-	*rvalue = value;
19
-	return result;
20
-}
21
-int pcibios_read_config_dword(unsigned int bus, unsigned int devfn, unsigned int reg, uint32_t *rvalue)
22
-{
23
-	unsigned long value;
24
-	long result;
25
-	result = sal_pci_config_read(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 4, &value);
26
-	*rvalue = value;
27
-	return result;
28
-}
29
-
30
-int pcibios_write_config_byte(unsigned int bus, unsigned int devfn, unsigned int reg, uint8_t value)
31
-{
32
-	return  sal_pci_config_write(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 1, value);
33
-}
34
-
35
-int pcibios_write_config_word(unsigned int bus, unsigned int devfn, unsigned int reg, uint16_t value)
36
-{
37
-	return  sal_pci_config_write(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 2, value);
38
-}
39
-
40
-int pcibios_write_config_dword(unsigned int bus, unsigned int devfn, unsigned int reg, uint32_t value)
41
-{
42
-	return  sal_pci_config_write(PCI_SAL_ADDRESS(0,bus, 0, devfn, reg), 4, value);
43
-}
44
-
45
-/* So far I have not see a non-zero PCI_BUS_OFFSET
46
- * and an AML parser to get it much to much trouble.
47
- */
48
-#ifndef PCI_BUS_OFFSET
49
-#define PCI_BUS_OFFSET 0
50
-#endif
51
-
52
-unsigned long pcibios_bus_base(unsigned int bus)
53
-{
54
-	return PCI_BUS_OFFSET;
55
-}
56
-
57
-void find_pci(int type, struct pci_device *dev)
58
-{
59
-	/* Should I check for sal functions being present? */
60
-	return scan_pci_bus(type, dev);
61
-}
62
-

+ 0
- 133
src/arch/ia64/core/reloc.S View File

@@ -1,133 +0,0 @@
1
-/* reloc.S - position independent IA-64 ELF shared object relocator
2
-   Copyright (C) 1999 Hewlett-Packard Co.
3
-	Contributed by David Mosberger <davidm@hpl.hp.com>.
4
-   Copyright (C) 2002 Eric Biederman sponsored by Linux Networx
5
-
6
-   This file is part of etherboot.
7
-   This file was derived from reloc_ia64.S from GNU-EFI, the GNU EFI development environment.
8
-
9
-   GNU EFI is free software; you can redistribute it and/or modify
10
-   it under the terms of the GNU General Public License as published by
11
-   the Free Software Foundation; either version 2, or (at your option)
12
-   any later version.
13
-
14
-   GNU EFI is distributed in the hope that it will be useful,
15
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
-   GNU General Public License for more details.
18
-
19
-   You should have received a copy of the GNU General Public License
20
-   along with GNU EFI; see the file COPYING.  If not, write to the Free
21
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22
-   02111-1307, USA. */
23
-
24
-/*
25
- * This is written in assembly because the entire code needs to be position
26
- * independent.  Note that the compiler does not generate code that's position
27
- * independent by itself because it relies on the global offset table being
28
- * relocated.
29
- *
30
- * This code assumes the code was compiled with -mconstant-gp -mauto-pic -static -shared
31
- * Which generates position independent code, but not position indepedent data.
32
- * This code assumes in the linker script the rela entries are bracked with:
33
- * _rela, _erela and _rela_size gives the total size of the rela entries.
34
- * This gives a much smaller binary than when compiled as a true shared object.
35
- *
36
- * This code assumes the original shared object was initially relocated,
37
- * So that it only needs to apply changes for the new address the code is linked
38
- * at.
39
- */
40
-	.text
41
-	.psr abi64
42
-	.psr lsb
43
-	.lsb
44
-
45
-
46
-#define ST_VALUE_OFF	8		/* offset of st_value in elf sym */
47
-
48
-#define RET_SUCCESS		0
49
-#define RET_LOAD_ERROR		1
50
-
51
-#define R_IA64_NONE		0
52
-#define R_IA64_REL64MSB		0x6e
53
-#define R_IA64_REL64LSB		0x6f
54
-#define R_IA64_DIR64MSB		0x26
55
-#define R_IA64_DIR64LSB		0x27
56
-#define R_IA64_FPTR64MSB	0x46
57
-#define R_IA64_FPTR64LSB	0x47
58
-
59
-#define	delta	in0	/* Chaing in load address (address of .text) */
60
-
61
-#define ldbase	r15
62
-#define target  r16
63
-#define val	r17
64
-#define rela	r18
65
-#define relasz  r19
66
-#define relaent	r20
67
-#define addr	r21
68
-#define r_info	r22
69
-#define r_offset r23
70
-#define r_type	r25
71
-
72
-#define Pmore		p6
73
-
74
-#define Pnone		p6
75
-#define Prel		p7
76
-#define Pdir		p8
77
-
78
-
79
-	.global _relocate
80
-_relocate:
81
-	alloc		r2=ar.pfs,1,0,0,0
82
-	add		rela=@gprel(_rela),gp
83
-	add		ldbase=@gprel(_text),gp
84
-	add		r3=@ltoff(_rela_size),gp
85
-	;;
86
-	ld8		relasz = [r3]
87
-	mov		relaent=24
88
-	br.sptk.few	apply_relocs
89
-
90
-apply_loop:
91
-	ld8		r_offset = [rela]
92
-	add		addr = 8,rela
93
-	sub		relasz = relasz,relaent
94
-	
95
-	;;
96
-	ld8		r_info = [addr], 8
97
-	;; 
98
-	add		target = ldbase, r_offset
99
-	add		rela = rela,relaent
100
-	extr.u		r_type = r_info, 0, 32
101
-	;;
102
-	cmp.eq		Pnone,p0 = R_IA64_NONE, r_type
103
-	cmp.eq		Prel,p0  = R_IA64_REL64LSB, r_type
104
-	cmp.eq		Pdir,p0  = R_IA64_DIR64LSB, r_type /* Needed? */
105
-	;;
106
-(Pnone) br.cond.sptk.few apply_relocs
107
-(Prel)	br.cond.sptk.few apply_REL64
108
-(Pdir)  br.cond.sptk.few apply_DIR64 /* Needed? */
109
-	;; 
110
-
111
-apply_error:
112
-	mov		r8 = RET_LOAD_ERROR
113
-	br.ret.sptk.few	rp
114
-
115
-apply_REL64:
116
-apply_DIR64:
117
-	ld8		val = [target]
118
-	;;
119
-	add		val = val, delta
120
-	;;
121
-	st8		[target] = val
122
-	;; 
123
-	/* fall through to apply_relocs */
124
-apply_relocs:
125
-	cmp.ltu		Pmore,p0=0,relasz
126
-(Pmore) br.cond.sptk.few	apply_loop
127
-	;; 
128
-
129
-	mov		r8 = RET_SUCCESS
130
-	br.ret.sptk.few	rp
131
-	
132
-	.size	_relocate, . - _relocate
133
-	.endp _relocate

+ 0
- 92
src/arch/ia64/core/relocate_to.S View File

@@ -1,92 +0,0 @@
1
-	/* Temporarily ignore the stack, as I am still using efi's stack */
2
-
3
-#define newbase in0
4
-#define base    loc2
5
-#define newgp   loc3
6
-#define len	loc4
7
-
8
-	.explicit		
9
-	.globl relocate_to
10
-	.proc relocate_to
11
-relocate_to:
12
-	/* In incoming variable the new base addres of etherboot. */
13
-	alloc	loc0=ar.pfs,1,5,3,0 /* in, local, out, rotating */
14
-	mov	loc1=rp
15
-
16
-	/* Compute the current location of _text */
17
-	/* Compute the new gp value */
18
-	add	base=@gprel(_text),gp
19
-	add	len =@gprel(_end),gp
20
-	movl	newgp=@gprel(_text)
21
-	;;
22
-	sub	newgp=newbase,newgp /* gp = _text - @gprel(_text) */
23
-	sub	len=len,base
24
-	;; 
25
-
26
-	/* Copy etherboot to the new location */
27
-	mov	out0=newbase
28
-	mov	out1=base
29
-	mov	out2=len
30
-	br.call.sptk.few rp=memcpy
31
-	;;
32
-
33
-	/* Jump to my __relocate_to in the new location */
34
-	movl	r14=@gprel(__relocate_to)
35
-	;;
36
-	add	r14=r14,newgp
37
-	;;
38
-	mov	b6=r14
39
-	;;
40
-	br.cond.sptk.few b6
41
-	;; 
42
-__relocate_to:	
43
-	/* I am at the new location set the newgp as the default */
44
-	mov	gp=newgp
45
-	;; 
46
-	/* New apply relocations to the new copy */
47
-	sub	out0=newbase,base
48
-	br.call.sptk.few rp=_relocate
49
-	;;
50
-
51
-	/* Lookup restart_etherboot */
52
-	add	out0=@gprel(restart_etherboot),gp
53
-	;;
54
-	
55
-	/* Adjust the gp and return address.
56
-	 * NOTE: This only works when the setjmp can modify it's caller's gp
57
-	 * address.  Essentially this means etherboot must be compiled with
58
-	 * compiled with -mconstant-gp, though an inline version of setjmp might work.
59
-	 */
60
-	add	r14=0x40,out0
61
-	add	r16=0x08,out0
62
-	;; 
63
-	ld8	r15=[r14]
64
-	ld8	r17=[r16]
65
-	;;	
66
-	sub	r15=r15,base
67
-	sub	r17=r17,base
68
-	;;
69
-	add	r15=r15,newbase
70
-	add	r17=r17,newbase
71
-	;;
72
-	st8	[r14]=r15
73
-	st8	[r16]=r17
74
-	;;
75
-	mov	out1=256
76
-	br.call.sptk.few rp=longjmp
77
-
78
-	/* And just in case lonjmp returns... */
79
-	
80
-	
81
-	/* Adjust my return address and return */
82
-	sub	loc1=loc1,base
83
-	;;
84
-	add	loc1=loc1,newbase
85
-	;;
86
-	mov	ar.pfs=loc0
87
-	mov	rp=loc1
88
-	;;
89
-	br.ret.sptk.few rp
90
-	
91
-	.size relocate_to, . - relocate_to
92
-	.endp relocate_to

+ 0
- 278
src/arch/ia64/core/sal.c View File

@@ -1,278 +0,0 @@
1
-#include "etherboot.h"
2
-#include "sal.h"
3
-
4
-struct sal_entry_base {
5
-	uint8_t entry_type;
6
-#define SAL_TYPE_ENTRYPOINT           0
7
-#define SAL_TYPE_MEMORY               1
8
-#define SAL_TYPE_PLATFORM_FEATURES    2
9
-#define SAL_TYPE_TRANSLATION_REGISTER 3
10
-#define SAL_TYPE_PURGE_DOMAIN         4
11
-#define SAL_TYPE_AP_WAKEUP            5
12
-};
13
-
14
-struct sal_entry_point_descriptor {
15
-	uint8_t  entry_type;
16
-	uint8_t  reserved[7];
17
-	uint64_t pal_proc;
18
-	uint64_t sal_proc;
19
-	uint64_t sal_gp;
20
-	uint8_t  reserved2[16];
21
-};
22
-
23
-struct sal_memory_descriptor {
24
-	uint8_t  entry_type;
25
-	uint8_t  sal_needs_virt_mapping;
26
-	uint8_t  mem_attr;
27
-#define MEM_ATTR_WB   0
28
-#define MEM_ATTR_UC   8
29
-#define MEM_ATTR_UCE  9
30
-#define MEM_ATTR_WC  10	
31
-	uint8_t  access_rights;
32
-	uint8_t  mem_attr_support;
33
-#define MEM_ATTR_SUPPORTS_WB  1
34
-#define MEM_ATTR_SUPPORTS_UC  2
35
-#define MEM_ATTR_SUPPORTS_UCE 4
36
-#define MEM_ATTR_SUPPORTS_WC  8
37
-	uint8_t  reserved;
38
-	uint8_t  mem_type;
39
-#define MEM_TYPE_RAM         0
40
-#define MEM_TYPE_MIO         1
41
-#define MEM_TYPE_SAPIC       2
42
-#define MEM_TYPE_PIO         3
43
-#define MEM_TYPE_FIRMWARE    4
44
-#define MEM_TYPE_BAD_RAM     9
45
-#define MEM_TYPE_BLACK_HOLE 10
46
-	uint8_t  mem_usage;
47
-#define MEM_USAGE_UNSPECIFIED            0
48
-#define MEM_USAGE_PAL_CODE               1
49
-#define MEM_USAGE_BOOT_SERVICES_CODE     2
50
-#define MEM_USAGE_BOOT_SERVICES_DATA     3
51
-#define MEM_USAGE_RUNTIME_SERVICES_CODE  4
52
-#define MEM_USAGE_RUNTIME_SERVICES_DATA  5
53
-#define MEM_USAGE_IA32_OPTION_ROM        6
54
-#define MEM_USAGE_IA32_SYSTEM_ROM        7
55
-#define MEM_USAGE_ACPI_RECLAIM_MEMORY    8
56
-#define MEM_USAGE_ACPI_NVS_MEMORY        9
57
-#define MEM_USAGE_SAL_PMI_CODE          10
58
-#define MEM_USAGE_SAL_PMI_DATA          11
59
-#define MEM_USAGE_FIRMWARE_RESERVED_RAM 12
60
-
61
-#define MEM_USAGE_CPU_TO_IO              0
62
-	uint64_t phys_address;
63
-	uint32_t pages; /* In 4k pages */
64
-	uint32_t reserved2; 
65
-	uint8_t  oem_reserved[8];
66
-};
67
-
68
-struct sal_platform_features {
69
-	uint8_t  entry_type;
70
-	uint8_t  feature_list;
71
-#define SAL_FEATURE_BUS_LOCK                   1
72
-#define SAL_FEATURE_PLATFORM_REDIRECTION_HINT  2
73
-#define SAL_FEATURE_PROCESSOR_REDIRECTION_HINT 3
74
-	uint8_t  reserved[14];
75
-};
76
-struct sal_translation_register {
77
-	uint8_t  entry_type;
78
-	uint8_t  tr_type;
79
-#define SAL_ITR 0
80
-#define SAL_DTR 1
81
-	uint8_t  tr_number;
82
-	uint8_t  reserved[5];
83
-	uint64_t virtual_address;
84
-	uint64_t page_size;
85
-	uint8_t  reserved2[8];
86
-};
87
-
88
-struct sal_purge_translation_cache_coherency_domain {
89
-	uint8_t  entry_type;
90
-	uint8_t  reserved[3];
91
-	uint32_t coherence_domain_count;
92
-	uint64_t coherence_domain_addr;
93
-};
94
-
95
-struct sal_ap_wakeup_descriptor {
96
-	uint8_t  entry_type;
97
-	uint8_t  wakeup_mechanism;
98
-	uint8_t  reserved[6];
99
-	uint64_t interrupt;
100
-};
101
-
102
-struct sal_entry {
103
-	union {
104
-		struct sal_entry_base base;
105
-		struct sal_entry_point_descriptor entry_point;
106
-		struct sal_memory_descriptor mem;
107
-		struct sal_platform_features features;
108
-		struct sal_translation_register tr;
109
-		struct sal_purge_translation_cache_coherency_domain purge;
110
-		struct sal_ap_wakeup_descriptor ap_wakeup;
111
-	};
112
-};
113
-
114
-struct sal_system_table {
115
-	uint8_t  signature[4]; /* SST_ */
116
-	uint32_t table_length;
117
-
118
-	uint16_t sal_rev;
119
-	uint16_t entry_count;
120
-	uint8_t  checksum;
121
-	uint8_t  reserved1[7];
122
-	uint16_t sal_a_version;
123
-	uint16_t sal_b_version;
124
-
125
-	uint8_t  oem_id[32];
126
-	uint8_t  product_id[32];
127
-	uint8_t  reserved2[8];
128
-	struct sal_entry entry[0];
129
-};
130
-
131
-static struct sal_system_table *sal;
132
-struct fptr sal_entry;
133
-
134
-int parse_sal_system_table(void *table)
135
-{
136
-	struct sal_system_table *salp = table;
137
-	uint8_t *ptr;
138
-	uint8_t checksum;
139
-	struct sal_entry *entry;
140
-	unsigned i;
141
-	if (memcmp(salp->signature, "SST_", 4) != 0) {
142
-		return 0;
143
-	}
144
-	ptr = table;
145
-	checksum = 0;
146
-	for(i = 0; i < salp->table_length; i++) {
147
-		checksum += ptr[i];
148
-	}
149
-	if (checksum != 0) {
150
-		return 0;
151
-	}
152
-#if 0
153
-	printf("SALA: %hx SALB: %hx\n",
154
-		salp->sal_a_version,
155
-		salp->sal_b_version);
156
-	printf("SAL OEM: ");
157
-	for(i = 0; i < sizeof(salp->oem_id); i++) {
158
-		uint8_t ch = salp->oem_id[i];
159
-		if (ch == 0)
160
-			break;
161
-		printf("%c", ch);
162
-	}
163
-	printf("\n");
164
-
165
-	printf("SAL PRODUCT: ");
166
-	for(i = 0; i < sizeof(salp->product_id); i++) {
167
-		uint8_t ch = salp->product_id[i];
168
-		if (ch == 0)
169
-			break;
170
-		printf("%c", ch);
171
-	}
172
-	printf("\n");
173
-#endif
174
-	sal = salp;
175
-	pal_entry.entry = 0;
176
-	pal_entry.gp = 0;
177
-	sal_entry.entry = 0;
178
-	sal_entry.gp = 0;
179
-	entry = sal->entry;
180
-	i = 0;
181
-	while(i < salp->entry_count) {
182
-		unsigned long size = 0;
183
-
184
-		switch(entry->base.entry_type) {
185
-		case SAL_TYPE_ENTRYPOINT:
186
-			size = sizeof(entry->entry_point);
187
-			pal_entry.entry = entry->entry_point.pal_proc;
188
-			sal_entry.entry = entry->entry_point.sal_proc;
189
-			sal_entry.gp    = entry->entry_point.sal_gp;
190
-			break;
191
-		case SAL_TYPE_MEMORY:
192
-			size = sizeof(entry->mem);
193
-			break;
194
-		case SAL_TYPE_PLATFORM_FEATURES:
195
-			size = sizeof(entry->features);
196
-			break;
197
-		case SAL_TYPE_TRANSLATION_REGISTER:
198
-			size = sizeof(entry->tr);
199
-			break;
200
-		case SAL_TYPE_PURGE_DOMAIN:
201
-			size = sizeof(entry->purge);
202
-			break;
203
-		case SAL_TYPE_AP_WAKEUP:
204
-			size = sizeof(entry->ap_wakeup);
205
-			break;
206
-		default:
207
-			break;
208
-		}
209
-		entry = (struct sal_entry *)(((char *)entry) + size);
210
-		i++;
211
-	}
212
-	return 1;
213
-}
214
-
215
-#define SAL_SET_VECTORS			0x01000000
216
-#define SAL_GET_STATE_INFO		0x01000001
217
-#define SAL_GET_STATE_INFO_SIZE		0x01000002
218
-#define SAL_CLEAR_STATE_INFO		0x01000003
219
-#define SAL_MC_RENDEZ			0x01000004
220
-#define SAL_MC_SET_PARAMS		0x01000005
221
-#define SAL_REGISTER_PHYSICAL_ADDR	0x01000006
222
-
223
-#define SAL_CACHE_FLUSH			0x01000008
224
-#define SAL_CACHE_INIT			0x01000009
225
-#define SAL_PCI_CONFIG_READ		0x01000010
226
-#define SAL_PCI_CONFIG_WRITE		0x01000011
227
-#define SAL_FREQ_BASE			0x01000012
228
-
229
-#define SAL_UPDATE_PAL			0x01000020
230
-
231
-/*
232
- * Now define a couple of inline functions for improved type checking
233
- * and convenience.
234
- */
235
-long sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
236
-	unsigned long *drift_info)
237
-{
238
-	struct {
239
-		long status;
240
-		unsigned long ticks_per_second;
241
-		unsigned long drift_info;
242
-	} result, __call(void *,...);
243
-
244
-	result = __call(&sal_entry, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0); 
245
-
246
-	*ticks_per_second = result.ticks_per_second;
247
-	*drift_info = result.drift_info;
248
-	return result.status;
249
-}
250
-
251
-
252
-
253
-/* Read from PCI configuration space */
254
-long sal_pci_config_read (
255
-	unsigned long pci_config_addr, unsigned long size, unsigned long *value)
256
-{
257
-	struct {
258
-		long status;
259
-		unsigned long value;
260
-	} result, __call(void *,...);
261
-	
262
-	result = __call(&sal_entry, SAL_PCI_CONFIG_READ, pci_config_addr, size, 0, 0, 0, 0, 0);
263
-	if (value)
264
-		*value = result.value;
265
-	return result.status;
266
-}
267
-
268
-/* Write to PCI configuration space */
269
-long sal_pci_config_write (
270
-	unsigned long pci_config_addr, unsigned long size, unsigned long value)
271
-{
272
-	struct {
273
-		long status;
274
-	} result, __call(void *,...);
275
-
276
-	result = __call(&sal_entry, SAL_PCI_CONFIG_WRITE, pci_config_addr, size, value, 0, 0, 0, 0);
277
-	return result.status;
278
-}

+ 0
- 173
src/arch/ia64/core/setjmp.S View File

@@ -1,173 +0,0 @@
1
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
2
-   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
3
-
4
-   The GNU C Library is free software; you can redistribute it and/or
5
-   modify it under the terms of the GNU Lesser General Public
6
-   License as published by the Free Software Foundation; either
7
-   version 2.1 of the License, or (at your option) any later version.
8
-
9
-   The GNU C Library is distributed in the hope that it will be useful,
10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
-   Lesser General Public License for more details.
13
-
14
-   You should have received a copy of the GNU Lesser General Public
15
-   License along with the GNU C Library; if not, write to the Free
16
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
-   02111-1307 USA.
18
-
19
-   The layout of the jmp_buf is as follows.  This is subject to change
20
-   and user-code should never depend on the particular layout of
21
-   jmp_buf!
22
-
23
-
24
-  	offset:	description:
25
-	-------	------------
26
-  	0x000	stack pointer (r12)	; unchangeable (see _JMPBUF_UNWINDS)
27
-  	0x008	r1 (gp)
28
-	0x010	caller's unat
29
-	0x018	fpsr
30
-  	0x020	r4
31
-  	0x028	r5
32
-  	0x030	r6
33
-  	0x038	r7
34
-  	0x040	rp (b0)
35
-  	0x048	b1
36
-  	0x050	b2
37
-  	0x058	b3
38
-  	0x060	b4
39
-  	0x068	b5
40
-  	0x070	ar.pfs
41
-  	0x078	ar.lc
42
-  	0x080	pr
43
-  	0x088	ar.bsp			; unchangeable (see __longjmp.S)
44
-  	0x090	ar.unat
45
-	0x098	&__jmp_buf	; address of the jmpbuf (needed to locate NaT bits in unat)
46
-	0x0a0	 f2
47
-	0x0b0	 f3
48
-	0x0c0	 f4
49
-	0x0d0	 f5
50
-	0x0e0	f16
51
-  	0x0f0	f17
52
-  	0x100	f18
53
-  	0x110	f19
54
-  	0x120	f20
55
-  	0x130	f21
56
-  	0x130	f22
57
-  	0x140	f23
58
-  	0x150	f24
59
-  	0x160	f25
60
-  	0x170	f26
61
-  	0x180	f27
62
-  	0x190	f28
63
-  	0x1a0	f29
64
-  	0x1b0	f30
65
-  	0x1c0	f31 */
66
-
67
-
68
-	/* The following two entry points are the traditional entry points: */
69
-
70
-	.text
71
-	.global setjmp
72
-	.proc setjmp
73
-setjmp:
74
-	alloc r8=ar.pfs,2,0,0,0
75
-	mov in1=1
76
-	br.cond.sptk.many __sigsetjmp
77
-	.size setjmp, . - setjmp
78
-	.endp setjmp
79
-
80
-	/* __sigsetjmp(__jmp_buf buf, int savemask) */
81
-
82
-__sigsetjmp:
83
-#if 0
84
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
85
-#endif
86
-	alloc loc1=ar.pfs,2,2,2,0
87
-	mov r16=ar.unat
88
-	;;
89
-	mov r17=ar.fpsr
90
-	mov r2=in0
91
-	add r3=8,in0
92
-	;;
93
-	st8.spill.nta [r2]=sp,16	// r12 (sp)
94
-	st8.spill.nta [r3]=gp,16	// r1 (gp)
95
-	;;
96
-	st8.nta [r2]=r16,16		// save caller's unat
97
-	st8.nta [r3]=r17,16		// save fpsr
98
-	add r8=0xa0,in0
99
-	;;
100
-	st8.spill.nta [r2]=r4,16	// r4
101
-	st8.spill.nta [r3]=r5,16	// r5
102
-	add r9=0xb0,in0
103
-	;;
104
-	stf.spill.nta [r8]=f2,32
105
-	stf.spill.nta [r9]=f3,32
106
-	mov loc0=rp
107
-	.body
108
-	;;
109
-	stf.spill.nta [r8]=f4,32
110
-	stf.spill.nta [r9]=f5,32
111
-	mov r17=b1
112
-	;;
113
-	stf.spill.nta [r8]=f16,32
114
-	stf.spill.nta [r9]=f17,32
115
-	mov r18=b2
116
-	;;
117
-	stf.spill.nta [r8]=f18,32
118
-	stf.spill.nta [r9]=f19,32
119
-	mov r19=b3
120
-	;;
121
-	stf.spill.nta [r8]=f20,32
122
-	stf.spill.nta [r9]=f21,32
123
-	mov r20=b4
124
-	;;
125
-	stf.spill.nta [r8]=f22,32
126
-	stf.spill.nta [r9]=f23,32
127
-	mov r21=b5
128
-	;;
129
-	stf.spill.nta [r8]=f24,32
130
-	stf.spill.nta [r9]=f25,32
131
-	mov r22=ar.lc
132
-	;;
133
-	stf.spill.nta [r8]=f26,32
134
-	stf.spill.nta [r9]=f27,32
135
-	mov r24=pr
136
-	;;
137
-	stf.spill.nta [r8]=f28,32
138
-	stf.spill.nta [r9]=f29,32
139
-	;;
140
-	stf.spill.nta [r8]=f30
141
-	stf.spill.nta [r9]=f31
142
-
143
-	st8.spill.nta [r2]=r6,16	// r6
144
-	st8.spill.nta [r3]=r7,16	// r7
145
-	;;
146
-	mov r23=ar.bsp
147
-	mov r25=ar.unat
148
-	mov out0=in0
149
-
150
-	st8.nta [r2]=loc0,16		// b0
151
-	st8.nta [r3]=r17,16		// b1
152
-	mov out1=in1
153
-	;;
154
-	st8.nta [r2]=r18,16		// b2
155
-	st8.nta [r3]=r19,16		// b3
156
-	;;
157
-	st8.nta [r2]=r20,16		// b4
158
-	st8.nta [r3]=r21,16		// b5
159
-	;;
160
-	st8.nta [r2]=loc1,16		// ar.pfs
161
-	st8.nta [r3]=r22,16		// ar.lc
162
-	;;
163
-	st8.nta [r2]=r24,16		// pr
164
-	st8.nta [r3]=r23,16		// ar.bsp
165
-	;;
166
-	st8.nta [r2]=r25		// ar.unat
167
-	st8.nta [r3]=in0		// &__jmp_buf
168
-	mov r8=0
169
-	mov rp=loc0
170
-	mov ar.pfs=loc1
171
-	br.ret.sptk.many rp
172
-
173
-	.endp __sigsetjmp

+ 0
- 28
src/arch/ia64/core/start.S View File

@@ -1,28 +0,0 @@
1
-	.text
2
-	.align 4
3
-	.proc _start
4
-	.globl _start
5
-_start:
6
-	{
7
-	alloc			loc0 = ar.pfs,1,2,1,0	/* in, local, out, rotating */
8
-	mov			loc1 = rp
9
-	mov			r14 = ip		/* Get the address of _start */
10
-	}
11
-	movl			r15 = @gprel(_start)
12
-	;;
13
-	sub			gp = r14,r15
14
-	;;
15
-	rsm			psr.i	/* disable interrupts */
16
-	;; 
17
-	add			out0 = @gprel(_text),gp
18
-	br.call.sptk.few	rp = _relocate
19
-	;;
20
-	cmp.eq			p6,p7 = r0,r8		/* r8 == SUCCESS? */
21
-	mov			ar.pfs = loc0
22
-	mov			rp = loc1
23
-	;;
24
-(p6)	br.cond.sptk.few	main
25
-(p7)	br.ret.sptk.few		rp
26
-
27
-	.size _start, . - _start
28
-	.endp _start

+ 0
- 1079
src/arch/ia64/drivers/net/undi_nii.c
File diff suppressed because it is too large
View File


+ 0
- 36
src/arch/ia64/include/bits/byteswap.h View File

@@ -1,36 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_BYTESWAP_H
2
-#define ETHERBOOT_BITS_BYTESWAP_H
3
-
4
-static inline uint64_t __ia64_bswap_64(uint64_t x)
5
-{
6
-	uint64_t result;
7
-	__asm__ volatile(
8
-		"mux1 %0=%1,@rev" : 
9
-		"=r" (result) 
10
-		: "r" (x));
11
-	return result;
12
-}
13
-
14
-#define __bswap_constant_16(x) \
15
-	((uint16_t)((((uint16_t)(x) & 0x00ff) << 8) | \
16
-		(((uint16_t)(x) & 0xff00) >> 8)))
17
-
18
-#define __bswap_constant_32(x) \
19
-	((uint32_t)((((uint32_t)(x) & 0x000000ffU) << 24) | \
20
-		(((uint32_t)(x) & 0x0000ff00U) <<  8) | \
21
-		(((uint32_t)(x) & 0x00ff0000U) >>  8) | \
22
-		(((uint32_t)(x) & 0xff000000U) >> 24)))
23
-
24
-#define __bswap_16(x) \
25
-	(__builtin_constant_p(x) ? \
26
-	__bswap_constant_16(x) : \
27
-	(__ia64_bswap_64(x) >> 48))
28
-
29
-
30
-#define __bswap_32(x) \
31
-	(__builtin_constant_p(x) ? \
32
-	__bswap_constant_32(x) : \
33
-	(__ia64_bswap_64(x) >> 32))
34
-
35
-
36
-#endif /* ETHERBOOT_BITS_BYTESWAP_H */

+ 0
- 6
src/arch/ia64/include/bits/cpu.h View File

@@ -1,6 +0,0 @@
1
-#ifndef IA64_BITS_CPU_H
2
-#define IA64_BITS_CPU_H
3
-
4
-#define cpu_setup() do {} while(0)
5
-
6
-#endif /* IA64_BITS_CPU_H */

+ 0
- 11
src/arch/ia64/include/bits/elf.h View File

@@ -1,11 +0,0 @@
1
-#ifndef IA64_BITS_ELF_H
2
-#define IA64_BITS_ELF_H
3
-
4
-/* ELF Defines for the current architecture */
5
-#define	EM_CURRENT	EM_IA_64
6
-#define ELFDATA_CURRENT	ELFDATA2LSB
7
-
8
-#define ELF_CHECK_ARCH(x) \
9
-	((x).e_machine == EM_CURRENT)
10
-
11
-#endif /* IA64_BITS_ELF_H */

+ 0
- 6
src/arch/ia64/include/bits/endian.h View File

@@ -1,6 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_ENDIAN_H
2
-#define ETHERBOOT_BITS_ENDIAN_H
3
-
4
-#define __BYTE_ORDER __LITTLE_ENDIAN
5
-
6
-#endif /* ETHERBOOT_BITS_ENDIAN_H */

+ 0
- 6
src/arch/ia64/include/bits/string.h View File

@@ -1,6 +0,0 @@
1
-#ifndef ETHERBOOT_BITS_STRING_H
2
-#define ETHERBOOT_BITS_STRING_H
3
-
4
-/* define inline optimized string functions here */
5
-
6
-#endif /* ETHERBOOT_BITS_STRING_H */

+ 0
- 12
src/arch/ia64/include/hooks.h View File

@@ -1,12 +0,0 @@
1
-#ifndef ETHERBOOT_IA64_HOOKS_H
2
-#define ETHERBOOT_IA64_HOOKS_H
3
-
4
-#include <stdarg.h>
5
-
6
-void arch_main(in_call_data_t *data, va_list params);
7
-void arch_on_exit(int status);
8
-void arch_relocate_to(unsigned long addr);
9
-#define arch_relocated_from(old_addr) do {} while(0)
10
-
11
-
12
-#endif /* ETHERBOOT_IA64_HOOKS_H */

+ 0
- 228
src/arch/ia64/include/io.h View File

@@ -1,228 +0,0 @@
1
-#ifndef ETHERBOOT_IO_H
2
-#define ETHERBOOT_IO_H
3
-
4
-/* Don't require identity mapped physical memory,
5
- * osloader.c is the only valid user at the moment.
6
- */
7
-static inline unsigned long virt_to_phys(volatile const void *virt_addr)
8
-{
9
-	return ((unsigned long)virt_addr);
10
-}
11
-
12
-static inline void *phys_to_virt(unsigned long phys_addr)
13
-{
14
-	return (void *)(phys_addr);
15
-}
16
-
17
-/* virt_to_bus converts an addresss inside of etherboot [_start, _end]
18
- * into a memory address cards can use.
19
- */
20
-#define virt_to_bus virt_to_phys
21
-
22
-
23
-/* bus_to_virt reverses virt_to_bus, the address must be output
24
- * from virt_to_bus to be valid.  This function does not work on
25
- * all bus addresses.
26
- */
27
-#define bus_to_virt phys_to_virt
28
-
29
-/* ioremap converts a random 32bit bus address into something
30
- * etherboot can access.
31
- */
32
-static inline void *ioremap(unsigned long bus_addr, unsigned long length __unused)
33
-{
34
-	return bus_to_virt(bus_addr);
35
-}
36
-
37
-/* iounmap cleans up anything ioremap had to setup */
38
-static inline void iounmap(void *virt_addr __unused)
39
-{
40
-	return;
41
-}
42
-
43
-/* In physical mode the offset of uncached pages */
44
-#define PHYS_BASE (0x8000000000000000UL)
45
-
46
-/* Memory mapped IO primitives, we avoid the cache... */
47
-static inline uint8_t readb(unsigned long addr)
48
-{
49
-	return *((volatile uint8_t *)(PHYS_BASE | addr));
50
-}
51
-
52
-static inline uint16_t readw(unsigned long addr)
53
-{
54
-	return *((volatile uint16_t *)(PHYS_BASE | addr));
55
-}
56
-
57
-static inline uint32_t readl(unsigned long addr)
58
-{
59
-	return *((volatile uint32_t *)(PHYS_BASE | addr));
60
-}
61
-
62
-static inline uint64_t readq(unsigned long addr)
63
-{
64
-	return *((volatile uint64_t *)(PHYS_BASE | addr));
65
-}
66
-
67
-
68
-static inline void writeb(uint8_t val, unsigned long addr)
69
-{
70
-	*((volatile uint8_t *)(PHYS_BASE | addr)) = val;
71
-}
72
-
73
-static inline void writew(uint16_t val, unsigned long addr)
74
-{
75
-	*((volatile uint16_t *)(PHYS_BASE | addr)) = val;
76
-}
77
-
78
-static inline void writel(uint32_t val, unsigned long addr)
79
-{
80
-	*((volatile uint32_t *)(PHYS_BASE | addr)) = val;
81
-}
82
-
83
-static inline void writeq(uint64_t val, unsigned long addr)
84
-{
85
-	*((volatile uint64_t *)(PHYS_BASE | addr)) = val;
86
-}
87
-
88
-
89
-static inline void memcpy_fromio(void *dest, unsigned long src, size_t n)
90
-{
91
-	size_t i;
92
-	uint8_t *dp = dest;
93
-	for(i = 0; i < n; i++) {
94
-		*dp = readb(src);
95
-		dp++;
96
-		src++;
97
-	}
98
-}
99
-
100
-static inline void memcpy_toio(unsigned long dest , const void *src, size_t n)
101
-{
102
-	size_t i;
103
-	const uint8_t *sp = src;
104
-	for(i = 0; i < n; i++) {
105
-		writeb(*sp, dest);
106
-		sp++;
107
-		dest++;
108
-	}
109
-}
110
-
111
-/* IO space IO primitives, Itanium has a strange architectural mapping... */
112
-extern unsigned long io_base;
113
-#define __ia64_mf_a()	__asm__ __volatile__ ("mf.a" ::: "memory")
114
-#define __ia64_io_addr(port) ((void *)(PHYS_BASE | io_base | (((port) >> 2) << 12) | ((port) & 0xfff)))
115
-
116
-static inline uint8_t inb(unsigned long port)
117
-{
118
-	uint8_t result;
119
-	
120
-	result = *((volatile uint8_t *)__ia64_io_addr(port));
121
-	__ia64_mf_a();
122
-	return result;
123
-}
124
-
125
-static inline uint16_t inw(unsigned long port)
126
-{
127
-	uint8_t result;
128
-	result = *((volatile uint16_t *)__ia64_io_addr(port));
129
-	__ia64_mf_a();
130
-	return result;
131
-}
132
-
133
-static inline uint32_t inl(unsigned long port)
134
-{
135
-	uint32_t result;
136
-	result = *((volatile uint32_t *)__ia64_io_addr(port));
137
-	__ia64_mf_a();
138
-	return result;
139
-}
140
-
141
-static inline void outb(uint8_t val, unsigned long port)
142
-{
143
-	*((volatile uint8_t *)__ia64_io_addr(port)) = val;
144
-	__ia64_mf_a();
145
-}
146
-
147
-static inline void outw(uint16_t val, unsigned long port)
148
-{
149
-	*((volatile uint16_t *)__ia64_io_addr(port)) = val;
150
-	__ia64_mf_a();
151
-}
152
-
153
-static inline void outl(uint32_t val, unsigned long port)
154
-{
155
-	*((volatile uint32_t *)__ia64_io_addr(port)) = val;
156
-	__ia64_mf_a();
157
-}
158
-
159
-
160
-
161
-static inline void insb(unsigned long port, void *dst, unsigned long count)
162
-{
163
-	volatile uint8_t  *addr = __ia64_io_addr(port);
164
-	uint8_t *dp = dst;
165
-	__ia64_mf_a();
166
-	while(count--) 
167
-		*dp++ = *addr;
168
-	__ia64_mf_a();
169
-}
170
-
171
-static inline void insw(unsigned long port, void *dst, unsigned long count)
172
-{
173
-	volatile uint16_t  *addr = __ia64_io_addr(port);
174
-	uint16_t *dp = dst;
175
-	__ia64_mf_a();
176
-	while(count--) 
177
-		*dp++ = *addr;
178
-	__ia64_mf_a();
179
-}
180
-
181
-static inline void insl(unsigned long port, void *dst, unsigned long count)
182
-{
183
-	volatile uint32_t  *addr = __ia64_io_addr(port);
184
-	uint32_t *dp = dst;
185
-	__ia64_mf_a();
186
-	while(count--) 
187
-		*dp++ = *addr;
188
-	__ia64_mf_a();
189
-}
190
-
191
-static inline void outsb(unsigned long port, void *src, unsigned long count)
192
-{
193
-	const uint8_t *sp = src;
194
-	volatile uint8_t *addr = __ia64_io_addr(port);
195
-
196
-	while (count--)
197
-		*addr = *sp++;
198
-	__ia64_mf_a();
199
-}
200
-
201
-static inline void outsw(unsigned long port, void *src, unsigned long count)
202
-{
203
-	const uint16_t *sp = src;
204
-	volatile uint16_t *addr = __ia64_io_addr(port);
205
-
206
-	while (count--)
207
-		*addr = *sp++;
208
-	__ia64_mf_a();
209
-}
210
-
211
-static inline void outsl(unsigned long port, void *src, unsigned long count)
212
-{
213
-	const uint32_t *sp = src;
214
-	volatile uint32_t *addr = __ia64_io_addr(port);
215
-
216
-	while (count--)
217
-		*addr = *sp++;
218
-	__ia64_mf_a();
219
-}
220
-
221
-static inline unsigned long ia64_get_kr0(void)
222
-{
223
-	unsigned long r;
224
-	asm volatile ("mov %0=ar.k0" : "=r"(r));
225
-	return r;
226
-}
227
-
228
-#endif /* ETHERBOOT_IO_H */

+ 0
- 11
src/arch/ia64/include/latch.h View File

@@ -1,11 +0,0 @@
1
-#ifndef LATCH_H
2
-#define LATCH_H
3
-
4
-#define TICKS_PER_SEC		(1000UL)
5
-
6
-/* Fixed timer interval used for calibrating a more precise timer */
7
-#define LATCHES_PER_SEC		10
8
-
9
-void sleep_latch(void);
10
-
11
-#endif /* LATCH_H */

+ 0
- 57
src/arch/ia64/include/limits.h View File

@@ -1,57 +0,0 @@
1
-#ifndef LIMITS_H
2
-#define LIMITS_H	1
3
-
4
-/* Number of bits in a `char' */
5
-#define CHAR_BIT	8
6
-
7
-/* Minimum and maximum values a `signed char' can hold */
8
-#define SCHAR_MIN	(-128)
9
-#define SCHAR_MAX	127
10
-
11
-/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
12
-#define UCHAR_MAX	255
13
-
14
-/* Minimum and maximum values a `char' can hold */
15
-#define CHAR_MIN	SCHAR_MIN
16
-#define CHAR_MAX	SCHAR_MAX
17
-
18
-/* Minimum and maximum values a `signed short int' can hold */
19
-#define SHRT_MIN	(-32768)
20
-#define SHRT_MAX	32767
21
-
22
-/* Maximum value an `unsigned short' can hold. (Minimum is 0.) */
23
-#define USHRT_MAX	65535
24
-
25
-
26
-/* Minimum and maximum values a `signed int' can hold */
27
-#define INT_MIN		(-INT_MAX - 1)
28
-#define INT_MAX		2147483647
29
-
30
-/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
31
-#define UINT_MAX	4294967295U
32
-
33
-
34
-/* Minimum and maximum values a `signed int' can hold */
35
-#define INT_MIN		(-INT_MAX - 1)
36
-#define INT_MAX		2147483647
37
-
38
-/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
39
-#define UINT_MAX	4294967295U
40
-
41
-/* Minimum and maximum values a `signed long' can hold */
42
-#define LONG_MAX	9223372036854775807L
43
-#define LONG_MIN	(-LONG_MAX - 1L)
44
-
45
-/* Maximum value an `unsigned long' can hold. (Minimum is 0.) */
46
-#define ULONG_MAX	18446744073709551615UL
47
-
48
-/* Minimum and maximum values a `signed long long' can hold */
49
-#define LLONG_MAX	9223372036854775807LL
50
-#define LLONG_MIN	(-LONG_MAX - 1LL)
51
-
52
-
53
-/* Maximum value an `unsigned long long' can hold. (Minimum is 0.) */
54
-#define ULLONG_MAX	18446744073709551615ULL
55
-
56
-
57
-#endif /* LIMITS_H */

+ 0
- 11
src/arch/ia64/include/pal.h View File

@@ -1,11 +0,0 @@
1
-#ifndef IA64_PAL_H
2
-#define IA64_PAL_H
3
-
4
-struct pal_freq_ratio {
5
-	unsigned long den : 32, num : 32;	/* numerator & denominator */
6
-};
7
-extern long pal_freq_ratios(struct pal_freq_ratio *proc_ratio, 
8
-	struct pal_freq_ratio *bus_ratio, struct pal_freq_ratio *itc_ratio);
9
-
10
-
11
-#endif /* IA64_PAL_H */

+ 0
- 29
src/arch/ia64/include/sal.h View File

@@ -1,29 +0,0 @@
1
-#ifndef IA64_SAL_H
2
-#define IA64_SAL_H
3
-
4
-struct fptr {
5
-	unsigned long entry;
6
-	unsigned long gp;
7
-};
8
-extern struct fptr sal_entry;
9
-extern struct fptr pal_entry;
10
-extern int parse_sal_system_table(void *table);
11
-
12
-#define	SAL_FREQ_BASE_PLATFORM        0
13
-#define	SAL_FREQ_BASE_INTERVAL_TIMER  1
14
-#define	SAL_FREQ_BASE_REALTIME_CLOCK  2
15
-
16
-long sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
17
-	unsigned long *drift_info);
18
-
19
-#define PCI_SAL_ADDRESS(seg, bus, dev, fn, reg) \
20
-	((unsigned long)(seg << 24) | (unsigned long)(bus << 16) | \
21
-	 (unsigned long)(dev << 11) | (unsigned long)(fn << 8) | \
22
-	 (unsigned long)(reg))
23
-
24
-long sal_pci_config_read (
25
-	unsigned long pci_config_addr, unsigned long size, unsigned long *value);
26
-long sal_pci_config_write (
27
-	unsigned long pci_config_addr, unsigned long size, unsigned long value);
28
-
29
-#endif /* IA64_SAL_H */

+ 0
- 13
src/arch/ia64/include/setjmp.h View File

@@ -1,13 +0,0 @@
1
-#ifndef ETHERBOOT_SETJMP_H
2
-#define ETHERBOOT_SETJMP_H
3
-
4
-
5
-/* Define a type for use by setjmp and longjmp */
6
-#define JBLEN  70
7
-
8
-typedef long jmp_buf[JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
9
-
10
-extern int setjmp (jmp_buf env);
11
-extern void longjmp (jmp_buf env, int val);
12
-
13
-#endif /* ETHERBOOT_SETJMP_H */

+ 0
- 28
src/arch/ia64/include/stdint.h View File

@@ -1,28 +0,0 @@
1
-#ifndef STDINT_H
2
-#define STDINT_H
3
-
4
-typedef unsigned long      size_t;
5
-
6
-typedef unsigned char      uint8_t;
7
-typedef unsigned short     uint16_t;
8
-typedef unsigned int       uint32_t;
9
-typedef unsigned long      uint64_t;
10
-
11
-typedef signed char        int8_t;
12
-typedef signed short       int16_t;
13
-typedef signed int         int32_t;
14
-typedef signed long        int64_t;
15
-
16
-typedef signed char        s8;
17
-typedef unsigned char      u8;
18
-
19
-typedef signed short       s16;
20
-typedef unsigned short     u16;
21
-
22
-typedef signed int         s32;
23
-typedef unsigned int       u32;
24
-
25
-typedef signed long	   s64;
26
-typedef unsigned long      u64;
27
-
28
-#endif /* STDINT_H */

+ 0
- 63
src/arch/ia64/prefix/apply_efi_prefix.pl View File

@@ -1,63 +0,0 @@
1
-#!/usr/bin/perl -w
2
-#
3
-# Program to apply an efi header to an ia64 etherboot file.
4
-#
5
-# GPL Eric Biederman 2002
6
-#
7
-
8
-use strict;
9
-
10
-use bytes;
11
-
12
-main(@ARGV);
13
-
14
-sub usage
15
-{
16
-	my ($err) = @_;
17
-	print STDERR $err , "\n";
18
-	die "Usage $0 prrefix file bss_size\n";
19
-}
20
-sub main
21
-{
22
-	my ($prefix_name, $suffix_name, $bss_size) = @_;
23
-	usage("No prefix") unless (defined($prefix_name));
24
-	usage("No suffix") unless (defined($suffix_name));
25
-	usage("No bss size") unless (defined($bss_size));
26
-
27
-	open(PREFIX, "<$prefix_name") or die "Cannot open $prefix_name";
28
-	open(SUFFIX, "<$suffix_name") or die "Cannot open $suffix_name";
29
-
30
-	$/ = undef;
31
-	my $prefix = <PREFIX>; close(PREFIX);
32
-	my $suffix = <SUFFIX>; close(SUFFIX);
33
-
34
-	# Payload sizes.
35
-	my $payload_size = length($suffix);
36
-	my $payload_bss  = $bss_size;
37
-
38
-	# Update the image size
39
-	my $hdr_off          = unpack("V",substr($prefix, 0x3c, 4));
40
-	my $image_size_off   = 0x050 + $hdr_off;
41
-	my $img_mem_size_off = 0x0c0 + $hdr_off;
42
-	my $img_size_off    =  0x0c8 + $hdr_off;
43
-
44
-	my $image_size   = unpack("V", substr($prefix, $image_size_off, 4));
45
-	my $img_mem_size = unpack("V", substr($prefix, $img_mem_size_off, 4));
46
-	my $img_size     = unpack("V", substr($prefix, $img_size_off, 4));
47
-
48
-	$image_size   += $payload_size + $payload_bss;
49
-	$img_mem_size += $payload_size + $payload_bss;
50
-	$img_size     += $payload_size;
51
-
52
-	substr($prefix, $image_size_off, 4)   = pack("V", $image_size);
53
-	substr($prefix, $img_mem_size_off, 4) = pack("V", $img_mem_size);
54
-	substr($prefix, $img_size_off, 4)     = pack("V", $img_size);
55
-
56
-	#print(STDERR "image_size:   $image_size\n");
57
-	#print(STDERR "img_mem_size: $img_mem_size\n");
58
-	#print(STDERR "img_size:     $img_size\n");
59
-
60
-	print $prefix;
61
-	print $suffix;
62
-}
63
-

+ 0
- 198
src/arch/ia64/prefix/apply_unnrv2b_prefix.pl View File

@@ -1,198 +0,0 @@
1
-#!/usr/bin/perl -w
2
-#
3
-# Program to apply an unnrv2b decompressor header to an ia64 etherboot file.
4
-#
5
-# GPL Eric Biederman 2002
6
-#
7
-
8
-use strict;
9
-
10
-use bytes;
11
-
12
-main(@ARGV);
13
-
14
-sub usage
15
-{
16
-	my ($err) = @_;
17
-	print STDERR $err , "\n";
18
-	die "Usage $0 prefix file\n";
19
-}
20
-
21
-sub getbits
22
-{
23
-	my ($bundle, $start, $size) = @_;
24
-
25
-	# Compute the mask 
26
-	my $mask = 0xffffffff;
27
-	$mask = $mask >> (32 - $size);
28
-
29
-	# Compute the substring, and shift
30
-	my ($first, $end, $count, $shift);
31
-	$first = int($start / 8);
32
-	$end   = int(($start + $size + 7)/8);
33
-	$count = $end - $first;
34
-	$shift = $start % 8;
35
-
36
-	# Compute the unpack type
37
-	my $type;
38
-	if ($count == 1) {
39
-		$type = "C"
40
-	}
41
-	elsif ($count == 2) {
42
-		$type = "v";
43
-	}
44
-	elsif (($count >= 3) && ($count <= 4)) {
45
-		$type = "V";
46
-	}
47
-	else {
48
-		die "bad count $count";
49
-	}
50
-
51
-	# Now compute the value
52
-	my $val = (unpack($type, substr($bundle, $first, $count)) >> $shift) & $mask;
53
-	
54
-	# Now return the value
55
-	return $val;
56
-}
57
-
58
-sub putbits
59
-{
60
-	my ($bundle, $start, $size, $val) = @_;
61
-
62
-
63
-	# Compute the mask 
64
-	my $mask = 0xffffffff;
65
-	$mask >>= 32 - $size;
66
-
67
-	# Compute the substring, and shift
68
-	my ($first, $end, $count, $shift);
69
-	$first = int($start / 8);
70
-	$end   = int(($start + $size + 7)/8);
71
-	$count = $end - $first;
72
-	$shift = $start % 8;
73
-
74
-	# Compute the unpack type
75
-	my $type;
76
-	if ($count == 1) {
77
-		$type = "C"
78
-	}
79
-	elsif ($count == 2) {
80
-		$type = "v";
81
-	}
82
-	elsif (($count >= 3) && ($count <= 4)) {
83
-		$type = "V";
84
-	}
85
-	else {
86
-		die "bad count $count";
87
-	}
88
-
89
-	# Adjust the mask
90
-	$mask <<= $shift;
91
-
92
-	# Now set the value, preserving the untouched bits
93
-	substr($bundle, $first, $count) =
94
-	    pack($type, 
95
-		 ((unpack($type, substr($bundle, $first, $count)) & ~$mask) |
96
-		  (($val << $shift) & $mask)));
97
-
98
-	# Now return the new value;
99
-	return $bundle;
100
-}
101
-
102
-sub main
103
-{
104
-	my ($prefix_name, $suffix_name) = @_;
105
-	usage("No prefix") unless (defined($prefix_name));
106
-	usage("No suffix") unless (defined($suffix_name));
107
-
108
-	open(PREFIX, "<$prefix_name") or die "Cannot open $prefix_name";
109
-	open(SUFFIX, "<$suffix_name") or die "Cannot open $suffix_name";
110
-
111
-	$/ = undef;
112
-	my $prefix = <PREFIX>; close(PREFIX);
113
-	my $suffix = <SUFFIX>; close(SUFFIX);
114
-
115
-	# Payload sizes
116
-	my $prefix_len = length($prefix);
117
-	my $suffix_len = length($suffix);
118
-	my $payload_size = $suffix_len;
119
-	my $uncompressed_offset = ($prefix_len + $suffix_len + 15) & ~15;
120
-	my $pad = $uncompressed_offset - ($prefix_len + $suffix_len);
121
-
122
-	# Itaninum instruction bundle we will be updating
123
-	#  0 -   4  template == 5
124
-	#  5 -  45  slot 0  M-Unit 
125
-	# 46 -  86  slot 1  L-Unit 
126
-	# 87 - 127  slot 2  X-Unit
127
-	# Itaninum instruction format
128
-	# 40 - 37   Major opcode 
129
-	# ... 
130
-	#
131
-
132
-	# slot 1
133
-	#  0 - 40 [41] imm-41
134
-	# 10 - 40 [31] imm-41-hi
135
-	#  0 - 9  [10] imm-41-lo
136
-
137
-	# slot 2
138
-	#  0 -  5  [6] qp
139
-	#  6 - 12  [7] r1
140
-	# 13 - 19  [7] imm-7b
141
-	# 20       [1] vc
142
-	# 21       [1] immc
143
-	# 22 - 26  [5] imm-5c
144
-	# 27 - 35  [9] imm-9d
145
-	# 36       [1] imm0
146
-	# 37 - 40  [4] major opcode
147
-	#
148
-	
149
-	# major opcode should be 6
150
-
151
-	# Update the image size
152
-	my $uncompressed_offset_bundle_off = 16;
153
-	my $bundle = substr($prefix, $uncompressed_offset_bundle_off, 16);
154
-
155
-	my $template      = getbits($bundle, 0,  5);
156
-	my $op1_base      = 46;
157
-	my $op2_base      = 87;
158
-	my $major_opcode  = getbits($bundle, 37 + $op2_base, 4);
159
-
160
-	if (($template != 5) ||
161
-		($major_opcode != 6)) {
162
-		die "unknown second bundle cannot patch";
163
-	}
164
-
165
-	die "uncompressed_offset to big!\n" if ($uncompressed_offset > 0xffffffff);
166
-	my $immhi         = 0;
167
-	my $immlo         = $uncompressed_offset;
168
-	 
169
-	my $imm0          = ($immhi >> 31) & ((1 <<  1) - 1);
170
-	my $imm41_hi      = ($immhi >>  0) & ((1 << 31) - 1);
171
-	 
172
-	my $imm41_lo      = ($immlo >> 22) & ((1 << 10) - 1);
173
-	my $immc          = ($immlo >> 21) & ((1 <<  1) - 1);
174
-	my $imm5c         = ($immlo >> 16) & ((1 <<  5) - 1);
175
-	my $imm9d         = ($immlo >>  7) & ((1 <<  9) - 1);
176
-	my $imm7b         = ($immlo >>  0) & ((1 <<  7) - 1);
177
-
178
-	$bundle           = putbits($bundle, 10 + $op1_base, 31, $imm41_hi);
179
-	$bundle           = putbits($bundle,  0 + $op1_base, 10, $imm41_lo);
180
-	$bundle           = putbits($bundle, 36 + $op2_base, 1 , $imm0);
181
-	$bundle           = putbits($bundle, 27 + $op2_base, 9 , $imm9d);
182
-	$bundle           = putbits($bundle, 22 + $op2_base, 5 , $imm5c);
183
-	$bundle           = putbits($bundle, 21 + $op2_base, 1 , $immc);
184
-	$bundle           = putbits($bundle, 13 + $op2_base, 7 , $imm7b);
185
-
186
-	substr($prefix, $uncompressed_offset_bundle_off, 16) = $bundle;
187
-
188
-	#print (STDERR "prefix:                  $prefix_len\n");
189
-	#print (STDERR "suffix:                  $suffix_len\n");
190
-	#print (STDERR "pad:                     $pad\n");
191
-	#print (STDERR "uncompressed_offset:     $uncompressed_offset\n");
192
-
193
-	print $prefix;
194
-	print $suffix;
195
-	# Pad the resulting image by a few extra bytes... 
196
-	print pack("C", 0) x $pad;
197
-}
198
-

+ 0
- 195
src/arch/ia64/prefix/efi_prefix.S View File

@@ -1,195 +0,0 @@
1
-#include "elf.h"
2
-	.explicit
3
-
4
-	.section ".hdrs", "a"
5
-	/* First the DOS file header */
6
-
7
-
8
-dos_header:
9
-	.byte 'M', 'Z'	/* Signature */
10
-	.short dos_program_end - dos_program /* Length of image mod 512 bytes*/
11
-	.short 0x0001	/* Length of image in 512 byte pages */ /* FIXME */
12
-	.short 0x0000	/* Number of relocation items following header */
13
-	.short (dos_header_end - dos_header)/16	/* Size of header in 16 byte paragraphs */
14
-	.short 0x0001	/* Minimum number of paragraphs needed to run image */
15
-	.short 0x0001	/* Maximum number of paragraphs program would like */
16
-	.short 0x0000	/* Initial SS */
17
-
18
-	.short 0x00b8	/* Initial SP */
19
-	.short 0x0000	/* Negative checksum of image */
20
-	.short 0x0000	/* Initial IP */
21
-	.short 0x0000	/* Initial CS */
22
-	.short 0x0010	/* Offset in EXEC of first relocation item */
23
-	.short 0x0000	/* Overlay number */
24
-
25
-	.balign 16
26
-dos_header_end:
27
-dos_program:
28
-	.byte	0xdb	/* retf */
29
-	.balign 16
30
-dos_program_end:
31
-	.org	0x3c
32
-	.byte	pe_signature - dos_header,  0x00, 0x00, 0x00
33
-	.org	0x40		/* NOTE: set this to 0x80 for debugging, 0x40 otherwise */
34
-pe_signature:
35
-	.byte	'P', 'E', 0, 0
36
-coff_header:
37
-#define IMAGE_MACHINE_IA64	0x0200
38
-coff_machine:	.short	IMAGE_MACHINE_IA64
39
-coff_nsections:	.short	(section_headers_end - section_headers)/40
40
-coff_timdat:	.int	1038168747 /* Sun Nov 24 12:12:27 2002 */
41
-coff_symptr:	.int	0x00000000
42
-
43
-coff_nsyms:	.int	0x00000000
44
-coff_opthdr:	.short	pe_end - pe_header
45
-#define CF_RELOC_STRIPPED 0x0001
46
-#define CF_EXECUTABLE     0x0002
47
-#define CF_LINE_STRIPPED  0x0004
48
-#define CF_LOCAL_STRIPPED 0x0008
49
-#define CF_DEBUG_STRIPPED 0x0206
50
-coff_flags:	.short	CF_EXECUTABLE | CF_LINE_STRIPPED | CF_LOCAL_STRIPPED | CF_DEBUG_STRIPPED
51
-
52
-	/* Option header */
53
-pe_header:
54
-pe_magic:	.short	0x020b /* 020b or 010b? */
55
-pe_linker:	.byte	0x02, 0x38
56
-pe_text_size:	.int	_text_size
57
-pe_data_size:	.int	_data_size
58
-pe_bss_size:	.int	_bss_size
59
-pe_entry:	.int	_start_plabel_rva
60
-pe_text_base:	.int	_text_rva
61
-pe_image_base:	.quad	_image_base
62
-pe_sec_align:	.int	_sect_align
63
-pe_file_align:	.int	_file_align
64
-pe_os_major:	.short	0
65
-pe_os_minor:	.short	0
66
-pe_image_major:	.short	0
67
-pe_image_minro:	.short	0
68
-pe_sub_major:	.short	0
69
-pe_sub_minor:	.short	0
70
-pe_reserved:	.int	0
71
-pe_image_size:	.int	_image_size
72
-pe_hdrs_size:	.int	_hdrs_size
73
-pe_checksum:	.int	0 /* FIXME how do I compute the checksum, unnecessary */
74
-#define SUBSYS_EFI_APP                  10
75
-#define SUBSYS_EFI_BOOT_SERVICE_DRIVER  11
76
-#define SUBSYS_EFI_RUNTIME_DRIVER       12
77
-pe_subsys:	.short	SUBSYS_EFI_APP
78
-pe_dll_flags:	.short	0
79
-pe_stack_res:	.quad	0
80
-pe_stack_commit:.quad	0
81
-pe_heap_res:	.quad	0
82
-pe_heap_commit:	.quad	0
83
-pe_ld_flags:	.int	0
84
-pe_rvas:	.int	(rvas_end - rvas_start)/8
85
-
86
-rvas_start:
87
-rva_0_rva:	.int	0
88
-rva_0_size:	.int	0
89
-rva_1_rva:	.int	0
90
-rva_1_size:	.int	0
91
-rva_2_rva:	.int	0
92
-rva_2_size:	.int	0
93
-rva_3_rva:	.int	0
94
-rva_3_size:	.int	0
95
-rva_4_rva:	.int	0
96
-rva_4_size:	.int	0
97
-rva_5_rva:	.int	_reloc_rva
98
-rva_5_size:	.int	__reloc_size
99
-rvas_end:	
100
-pe_end:
101
-
102
-section_headers:
103
-#define SCN_CNT_CODE               0x00000020
104
-#define SCN_CNT_INITIALIZED_DATA   0x00000040
105
-#define SCN_CNT_UNINITIALIZED_DATA 0x00000080
106
-#define SCN_MEM_DISCARDABLE        0x02000000
107
-#define SCN_MEM_SHARED             0x10000000
108
-#define SCN_MEM_EXECUTE            0x20000000
109
-#define SCN_MEM_READ               0x40000000
110
-#define SCN_MEM_WRITE              0x80000000
111
-
112
-sec1_name:	.byte '.', 'i', 'm', 'g', 0 , 0, 0, 0
113
-sec1_virt_size:	.int	_img_mem_size
114
-sec1_virt_addr:	.int	_img_rva
115
-sec1_file_size:	.int	_img_size
116
-sec1_file_off:	.int	_img_off
117
-sec1_reloc_off:	.int	0
118
-sec1_line_off:	.int	0
119
-sec1_reloc_cnt:	.short	0
120
-sec1_line_cnt:	.short	0
121
-sec1_flags:	.int	SCN_CNT_CODE | SCN_CNT_INITIALIZED_DATA \
122
-			| SCN_MEM_EXECUTE | SCN_MEM_READ | SCN_MEM_WRITE
123
-
124
-section_headers_end:	
125
-
126
-	.text
127
-	.psr abi64
128
-	.psr lsb
129
-	.global _start
130
-_start:
131
-	{
132
-		alloc	r8=ar.pfs,2,0,0,0
133
-		mov	gp=ip		/* Get the address of _start/_text/__gp */
134
-	}
135
-	;;
136
-	add	r14=@gprel(n1_desc),gp
137
-	add	r15=@gprel(n2_desc),gp
138
-	add	r16=@gprel(bhdr),gp
139
-	;;
140
-	st8	[r14]=in0
141
-	st8	[r15]=in1
142
-	;;
143
-	mov	ar.pfs=r8
144
-	;; 
145
-	mov	r32=r16
146
-	;; 
147
-	br.sptk.few _payload_start
148
-
149
-	.data
150
-	.global _start_plabel
151
-	.balign 16
152
-_start_plabel:
153
-	.quad	_start
154
-	.quad	0	/* I don't need a gp value... */
155
-
156
-	/* hand-crafted bhdr and parameters */
157
-	.balign 16
158
-bhdr:
159
-b_signature:	.int	0x0E1FB007
160
-b_size:		.int	bhdr_end - bhdr
161
-b_checksum:	.short	0
162
-b_records:	.short	3
163
-		/* A NOP note to 64bit align later data */
164
-		.balign 4
165
-n0_namesz:	.int	0
166
-n0_descsz:	.int	0
167
-n0_type:	.int	EBN_NOP
168
-		.balign 4
169
-n1_namesz:	.int	10
170
-n1_descsz:	.int	8
171
-n1_type:	.int	EB_IA64_IMAGE_HANDLE
172
-n1_name:	.asciz	"Etherboot"
173
-		.balign 4
174
-n1_desc:	.quad	0
175
-		.balign 4
176
-n2_namesz:	.int	10
177
-n2_descsz:	.int	8
178
-n2_type:	.int	EB_IA64_SYSTAB
179
-n2_name:	.asciz	"Etherboot"
180
-		.balign 4
181
-n2_desc:	.quad	0
182
-bhdr_end:
183
-	
184
-
185
-	/* hand-craft a .reloc section for the plabel */
186
-#define IMAGE_REL_BASED_ABS	0
187
-#define IMAGE_REL_BASED_DIR64	10
188
-
189
-	.section ".reloc", "a"
190
-	.int	_start_plabel_rva			// PAGE RVA
191
-	.int	12					// Block Size (2*4+2*2)
192
-	.short	(IMAGE_REL_BASED_DIR64<<12) + 0 // reloc for plabel's entry point
193
-	.short	(IMAGE_REL_BASED_ABS  <<12) + 0	// dummy reloc for good alignment
194
-
195
-

+ 0
- 91
src/arch/ia64/prefix/efi_prefix.lds View File

@@ -1,91 +0,0 @@
1
-/* OUTPUT_FORMAT("binary") */
2
-OUTPUT_FORMAT("elf64-ia64-little")
3
-
4
-OUTPUT_ARCH(ia64)
5
-
6
-ENTRY(_start_plabel)
7
-_sect_align = 16; /* normally 512 */
8
-_file_align = 16; /* normally 4096 */
9
-/* Symbols for hardcoding the payload and _bss size, with apply_efi_prefix
10
- * there is no need to set these, and in will get confused if these are not 0.
11
- */
12
-_payload_size = 0;
13
-_payload_bss = 0;
14
-SECTIONS {
15
-	/* We can arbitrarily set image base to anything we want,
16
-	 * but efi does not honor it, so it is a pointless exercise.
17
-	 * So we just set the start address to 0.
18
-	 */
19
-	. = 0;
20
-	_link_base = . ;
21
-	_image_base = . ;
22
-	.hdrs : {
23
-		_hdrs = . ;
24
-		*(.hdrs)
25
-		. = ALIGN(_file_align) ;
26
-		_ehdrs = . ;
27
-	}
28
-	. = ALIGN(_sect_align);
29
-	.img : {
30
-		_img = . ;
31
-		_text = . ;
32
-		__gp = . ;
33
-		*(.text)
34
-		_etext = .;
35
-		. = ALIGN(16);
36
-		_data = . ;
37
-		*(.data)
38
-		_edata = .;
39
-		. = ALIGN(16);
40
-		_reloc = . ;
41
-		*(.reloc)
42
-		__ereloc = . ;
43
-		_ereloc = . ;
44
-		. = ALIGN(16);
45
-		/* . = ALIGN(_file_align) ; */
46
-	}
47
-	_payload_start = . ;
48
-	. = . + _payload_size ;
49
-	_payload_end = . ;
50
-	_eimg = . ;
51
-	. = ALIGN(_sect_align) ; 
52
-	_bss = . ;
53
-	.bss : {
54
-		*(.bss)
55
-		. = . + _payload_bss;
56
-	}
57
-	_ebss = . ;
58
-	_end = . ;
59
-	/DISCARD/ : {
60
-		*(*)
61
-	}
62
-
63
-	_hdrs_size = _ehdrs - _hdrs;
64
-	_hdrs_off = 0;
65
-
66
-	_text_size = _etext - _text ;
67
-	_text_rva = _text - _image_base ;
68
-	_text_off = _text - _link_base;
69
-	
70
-	_data_size = _edata - _data ;
71
-	_data_rva = _data - _image_base;
72
-	_data_off = _data - _link_base;
73
-
74
-	__reloc_size = __ereloc - _reloc ;
75
-	_reloc_size = _ereloc - _reloc ;
76
-	_reloc_rva = _reloc - _image_base;
77
-	_reloc_off = _reloc - _link_base;
78
-
79
-	_bss_size = _ebss - _bss;
80
-	_bss_rva = _bss - _image_base;
81
-
82
-	_img_size = _eimg - _img ;
83
-	_img_rva = _img - _image_base;
84
-	_img_off = _img - _link_base;
85
-
86
-	_img_mem_size = _ebss - _img;
87
-	
88
-	_image_size = _ebss - _link_base ;
89
-
90
-	_start_plabel_rva = _start_plabel - _image_base;
91
-}

+ 0
- 196
src/arch/ia64/prefix/unnrv2b.S View File

@@ -1,196 +0,0 @@
1
-/* 
2
- * Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
3
- * Copyright (C) 2002 Eric Biederman
4
- *
5
- * This file is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License as
7
- * published by the Free Software Foundation; either version 2 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * Originally this code was part of ucl the data compression library
11
- * for upx the ``Ultimate Packer of eXecutables''.
12
- *
13
- * - Converted to gas assembly, and refitted to work with etherboot.
14
- *   Eric Biederman 20 Aug 2002
15
- *
16
- * - Converted to functional ia64 assembly (Can this get smaller?)
17
- *   Eric Biederman 5 Dec 2002
18
- */
19
-	.text
20
-	.globl	_start
21
-_start:
22
-	/* See where I am running, and compute gp */
23
-	{
24
-		/* Do no call alloc here as I do not know how many argument
25
-		 * registers are being passed through the decompressor, and if I report
26
-		 * to few the unreported registers may get stomped.
27
-		 *
28
-		 * Instead just explicitly get the value of ar.pfs.
29
-		 */
30
-		mov		r17=0
31
-		mov		r8=ar.pfs
32
-		mov		gp = ip		/* The linker scripts sets gp at _start */
33
-	
34
-	}
35
-	{.mlx
36
-		movl		r9=0x123456789abcdef0	/* Get uncompressed_offset into r9 */
37
-	}
38
-	;;
39
-	{
40
-		add		r14 = @gprel(payload + 4),gp
41
-		add		r15 = r9,gp
42
-		mov		r16=1			/* last_m_off = 1 */
43
-	}
44
-	{
45
-		mov		r20 = 0xd00
46
-		add		r21 = r9,gp
47
-		br.sptk.few	decompr_loop_n2b
48
-	}
49
-	
50
-/* ------------- DECOMPRESSION -------------
51
-
52
- Input:
53
-   r8   - ar.pfs
54
-   r14  - source
55
-   r15  - dest
56
-   r16  - 1
57
-   r17  - (buffer) 0
58
-   r20  - 0xd00 (constant)
59
-   r21  - start address
60
- Usage:
61
-   r9   - scratch register for memory copies
62
-   r18  - scratch register for getbit
63
-   r19  - scratch register for loads and stores
64
- Output:
65
-   r2   - 0
66
-   r3   - 0
67
-*/
68
-
69
-getbit:
70
-	add			r18 = r17,r17
71
-	;;
72
-	cmp.ne			p8,p0 = r0,r18
73
-	cmp.leu			p6,p7 = r18,r17
74
-	;; 
75
-	mov			r17 = r18
76
-(p8)	br.cond.sptk.few	getbit_end
77
-	/* Do a unaligned 64bit load */
78
-	;;
79
-	ld1			r17 = [r14],1
80
-	;;
81
-	ld1			r18 = [r14],1
82
-	;;
83
-	dep			r17 = r18,r17,8,8
84
-	ld1			r18 = [r14],1
85
-	;;
86
-	dep			r17 = r18,r17,16,8
87
-	ld1			r18 = [r14],1
88
-	;;
89
-	dep			r17 = r18,r17,24,8
90
-	ld1			r18 = [r14],1
91
-	;;
92
-	dep			r17 = r18,r17,32,8
93
-	ld1			r18 = [r14],1
94
-	;;
95
-	dep			r17 = r18,r17,40,8
96
-	ld1			r18 = [r14],1
97
-	;;
98
-	dep			r17 = r18,r17,48,8
99
-	ld1			r18 = [r14],1
100
-	;;
101
-	dep			r17 = r18,r17,56,8
102
-	;;
103
-	add			r18 = r17,r17,1
104
-	;;
105
-	cmp.leu			p6,p7=r18,r17
106
-	;; 
107
-	mov			r17=r18
108
-	;;
109
-getbit_end:
110
-	br.ret.sptk.few		b6
111
-	
112
-	
113
-decompr_literals_n2b:
114
-	ld1			r19 = [r14],1
115
-	;;
116
-	st1			[r15] = r19,1
117
-	;; 
118
-decompr_loop_n2b:
119
-	br.call.sptk.few	b6 = getbit
120
-	;;
121
-(p6)	br.cond.sptk.few	decompr_literals_n2b
122
-(p7)	add			r2 = 1,r0		/* m_off = 1 */
123
-	;; 
124
-loop1_n2b:
125
-	br.call.sptk.few	b6 = getbit
126
-	;; 
127
-(p6)	add			r2 = r2,r2,1		/* m_off = m_off*2 + getbit() */
128
-(p7)	add			r2 = r2,r2
129
-	br.call.sptk.few	b6 = getbit
130
-	;; 
131
-(p7)	br.cond.sptk.few	loop1_n2b		/* while(!getbit()) */
132
-	;; 
133
-	mov			r3 = r0
134
-	cmp.eq			p6,p0 = 2,r2
135
-	add			r2 = -3,r2
136
-(p6)	br.cond.sptk.few	decompr_ebpeax_n2b	/* if (m_off == 2) goto decompr_ebpeax_n2b ? */
137
-	;;
138
-	ld1			r19 = [r14],1
139
-	shl			r2 = r2,8
140
-	;;
141
-	dep			r2 = r19,r2,0,8		/* m_off = (m_off - 3)*256 + src[ilen++] */
142
-	;;
143
-	cmp4.eq			p6,p0 = -1,r2		/* if (m_off == 0xffffffff) goto decomp_end_n2b */
144
-	;; 
145
-(p6)	br.cond.sptk.few	decompr_end_n2b
146
-	mov			r16 = r2		/* last_m_off = m_off */
147
-	;;
148
-decompr_ebpeax_n2b:	
149
-	br.call.sptk.few	b6 = getbit
150
-	;; 
151
-(p6)	add			r3 = r3,r3,1		/* m_len = getbit() */
152
-(p7)	add			r3 = r3,r3
153
-	br.call.sptk.few	b6 = getbit
154
-	;; 
155
-(p6)	add			r3 = r3,r3,1		/* m_len = m_len*2 + getbit()) */
156
-(p7)	add			r3 = r3,r3
157
-	;;
158
-	cmp.ne			p6,p0 = r0,r3
159
-(p6)	br.cond.sptk.few	decompr_got_mlen_n2b	/* if (m_len == 0) goto decompr_got_mlen_n2b */
160
-	add			r3 = 1,r3		/* m_len++ */
161
-	;; 
162
-loop2_n2b:
163
-	br.call.sptk.few	b6 = getbit
164
-	;; 
165
-(p6)	add			r3 = r3,r3,1		/* m_len = m_len*2 + getbit() */
166
-(p7)	add			r3 = r3,r3
167
-	br.call.sptk.few	b6 = getbit
168
-	;;
169
-(p7)	br.cond.sptk.few	loop2_n2b		/* while(!getbit()) */
170
-	add			r3 = 2, r3		/* m_len += 2 */
171
-	;; 
172
-decompr_got_mlen_n2b:
173
-	cmp.gtu			p6,p7 = r16, r20
174
-	;; 
175
-(p6)	add			r3 = 2, r3		/* m_len = m_len + 1 + (last_m_off > 0xd00) */
176
-(p7)	add			r3 = 1, r3
177
-	sub			r9 = r15, r16,1		/* m_pos = dst + olen - last_m_off - 1  */
178
-	;;
179
-1:
180
-	ld1			r19 = [r9],1
181
-	add			r3 = -1,r3
182
-	;;
183
-	st1			[r15] = r19,1		/* dst[olen++] = *m_pos++ while(m_len > 0) */
184
-	cmp.ne			p6,p0 = r0,r3
185
-(p6)	br.cond.sptk.few	1b
186
-	;;
187
-	br.cond.sptk.few	decompr_loop_n2b
188
-decompr_end_n2b:
189
-	/* Branch to the start address */
190
-	mov			ar.pfs=r8
191
-	;;
192
-	mov			b6 = r21
193
-	;; 
194
-	br.sptk.few		b6
195
-
196
-payload:

+ 0
- 28
src/arch/ia64/prefix/unnrv2b.lds View File

@@ -1,28 +0,0 @@
1
-OUTPUT_FORMAT("elf64-ia64-little")
2
-
3
-OUTPUT_ARCH(ia64)
4
-
5
-ENTRY(_start)
6
-SECTIONS {
7
-	. = 0;
8
-	__gp = .;
9
-	_text = . ;
10
-	.text : {
11
-		*(.text)
12
-	}
13
-	/DISCARD/ : {
14
-		*(.comment)
15
-		*(.note)
16
-		*(.hash)
17
-		*(.data)
18
-		*(.sbss)
19
-		*(.bss)
20
-		*(.dynstr)
21
-		*(.dynsym)
22
-		*(.IA_64.unwind)
23
-		*(.IA_64.unwind_info)
24
-		*(.IA64_unwind)
25
-		*(.IA64_unwind_info)
26
-		*(.dynamic)
27
-	}
28
-}

Loading…
Cancel
Save