/[qemu]/qemu/hw/sun4m.c
ViewVC logotype

Diff of /qemu/hw/sun4m.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by bellard, Tue Feb 22 19:08:41 2005 UTC revision 1.5 by bellard, Tue Mar 1 21:51:04 2005 UTC
# Line 25  Line 25 
25  #include "m48t08.h"  #include "m48t08.h"
26    
27  #define KERNEL_LOAD_ADDR     0x00004000  #define KERNEL_LOAD_ADDR     0x00004000
28    #define CMDLINE_ADDR         0x007ff000
29  #define INITRD_LOAD_ADDR     0x00800000  #define INITRD_LOAD_ADDR     0x00800000
30  #define PROM_ADDR            0xffd00000  #define PROM_ADDR            0xffd00000
31  #define PROM_FILENAMEB       "proll.bin"  #define PROM_FILENAMEB       "proll.bin"
# Line 64  void DMA_run() {} Line 65  void DMA_run() {}
65    
66  static m48t08_t *nvram;  static m48t08_t *nvram;
67    
68  static void nvram_init(m48t08_t *nvram, uint8_t *macaddr)  static void nvram_init(m48t08_t *nvram, uint8_t *macaddr, const char *cmdline)
69  {  {
70      unsigned char tmp = 0;      unsigned char tmp = 0;
71      int i, j;      int i, j;
72    
73        i = 0x40;
74        if (cmdline) {
75            uint32_t cmdline_len;
76    
77            strcpy(phys_ram_base + CMDLINE_ADDR, cmdline);
78            m48t08_write(nvram, i++, CMDLINE_ADDR >> 24);
79            m48t08_write(nvram, i++, (CMDLINE_ADDR >> 16) & 0xff);
80            m48t08_write(nvram, i++, (CMDLINE_ADDR >> 8) & 0xff);
81            m48t08_write(nvram, i++, CMDLINE_ADDR & 0xff);
82    
83            cmdline_len = strlen(cmdline);
84            m48t08_write(nvram, i++, cmdline_len >> 24);
85            m48t08_write(nvram, i++, (cmdline_len >> 16) & 0xff);
86            m48t08_write(nvram, i++, (cmdline_len >> 8) & 0xff);
87            m48t08_write(nvram, i++, cmdline_len & 0xff);
88        }
89    
90      i = 0x1fd8;      i = 0x1fd8;
91      m48t08_write(nvram, i++, 0x01);      m48t08_write(nvram, i++, 0x01);
92      m48t08_write(nvram, i++, 0x80); /* Sun4m OBP */      m48t08_write(nvram, i++, 0x80); /* Sun4m OBP */
# Line 149  void sun4m_init(int ram_size, int vga_ra Line 167  void sun4m_init(int ram_size, int vga_ra
167      tcx = tcx_init(ds, PHYS_JJ_TCX_FB, phys_ram_base + ram_size, ram_size, vram_size);      tcx = tcx_init(ds, PHYS_JJ_TCX_FB, phys_ram_base + ram_size, ram_size, vram_size);
168      lance_init(&nd_table[0], PHYS_JJ_LE_IRQ, PHYS_JJ_LE, PHYS_JJ_LEDMA);      lance_init(&nd_table[0], PHYS_JJ_LE_IRQ, PHYS_JJ_LE, PHYS_JJ_LEDMA);
169      nvram = m48t08_init(PHYS_JJ_EEPROM, PHYS_JJ_EEPROM_SIZE);      nvram = m48t08_init(PHYS_JJ_EEPROM, PHYS_JJ_EEPROM_SIZE);
170      nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr);      nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline);
171      slavio_timer_init(PHYS_JJ_CLOCK, PHYS_JJ_CLOCK_IRQ, PHYS_JJ_CLOCK1, PHYS_JJ_CLOCK1_IRQ);      slavio_timer_init(PHYS_JJ_CLOCK, PHYS_JJ_CLOCK_IRQ, PHYS_JJ_CLOCK1, PHYS_JJ_CLOCK1_IRQ);
172      slavio_serial_ms_kbd_init(PHYS_JJ_MS_KBD, PHYS_JJ_MS_KBD_IRQ);      slavio_serial_ms_kbd_init(PHYS_JJ_MS_KBD, PHYS_JJ_MS_KBD_IRQ);
173      slavio_serial_init(PHYS_JJ_SER, PHYS_JJ_SER_IRQ, serial_hds[0], serial_hds[1]);      slavio_serial_init(PHYS_JJ_SER, PHYS_JJ_SER_IRQ, serial_hds[0], serial_hds[1]);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26