Changeset f6f22cdb in mainline


Ignore:
Timestamp:
2013-12-27T18:45:56Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32e8cd1
Parents:
e47ed05
Message:

code revision
coding style changes

Location:
boot/arch/sparc32
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc32/Makefile.inc

    re47ed05 rf6f22cdb  
    4040
    4141BITS = 32
    42 ENDIANESS = LE
     42ENDIANESS = BE
    4343
    4444SOURCES = \
  • boot/arch/sparc32/_link.ld.in

    re47ed05 rf6f22cdb  
    2626        }
    2727        bdata_end = .;
    28 
     28       
    2929        /DISCARD/ : {
    3030                *(.gnu.*);
  • boot/arch/sparc32/include/ambapp.h

    re47ed05 rf6f22cdb  
    3737#define BOOT_sparc32_AMBAPP_H
    3838
    39 #define AMBAPP_MAX_DEVICES      64
    40 #define AMBAPP_AHBMASTER_AREA   0xfffff000
    41 #define AMBAPP_AHBSLAVE_AREA    0xfffff800
    42 #define AMBAPP_CONF_AREA        0xff000
     39#define AMBAPP_MAX_DEVICES     64
     40#define AMBAPP_AHBMASTER_AREA  0xfffff000
     41#define AMBAPP_AHBSLAVE_AREA   0xfffff800
     42#define AMBAPP_CONF_AREA       0xff000
    4343
    4444typedef enum {
    45         GAISLER                 = 1,
    46         ESA                     = 4
     45        GAISLER = 1,
     46        ESA = 4
    4747} amba_vendor_id_t;
    4848
    4949typedef enum {
    50         GAISLER_LEON3           = 0x003,
    51         GAISLER_LEON3DSU        = 0x004,
    52         GAISLER_ETHAHB          = 0x005,
    53         GAISLER_APBMST          = 0x006,
    54         GAISLER_AHBUART         = 0x007,
    55         GAISLER_SRCTRL          = 0x008,
    56         GAISLER_SDCTRL          = 0x009,
    57         GAISLER_APBUART         = 0x00C,
    58         GAISLER_IRQMP           = 0x00D,
    59         GAISLER_AHBRAM          = 0x00E,
    60         GAISLER_GPTIMER         = 0x011,
    61         GAISLER_PCITRG          = 0x012,
    62         GAISLER_PCISBRG         = 0x013,
    63         GAISLER_PCIFBRG         = 0x014,
    64         GAISLER_PCITRACE        = 0x015,
    65         GAISLER_PCIDMA          = 0x016,
    66         GAISLER_AHBTRACE        = 0x017,
    67         GAISLER_ETHDSU          = 0x018,
    68         GAISLER_PIOPORT         = 0x01A,
    69         GAISLER_AHBJTAG         = 0x01c,
    70         GAISLER_SPW             = 0x01f,
    71         GAISLER_ATACTRL         = 0x024,
    72         GAISLER_VGA             = 0x061,
    73         GAISLER_KBD             = 0x060,
    74         GAISLER_ETHMAC          = 0x01D,
    75         GAISLER_DDRSPA          = 0x025,
    76         GAISLER_EHCI            = 0x026,
    77         GAISLER_UHCI            = 0x027,
    78         GAISLER_SPW2            = 0x029,
    79         GAISLER_DDR2SPA         = 0x02E,
    80         GAISLER_AHBSTAT         = 0x052,
    81         GAISLER_FTMCTRL         = 0x054,
    82         ESA_MCTRL               = 0x00F,
     50        GAISLER_LEON3    = 0x003,
     51        GAISLER_LEON3DSU = 0x004,
     52        GAISLER_ETHAHB   = 0x005,
     53        GAISLER_APBMST   = 0x006,
     54        GAISLER_AHBUART  = 0x007,
     55        GAISLER_SRCTRL   = 0x008,
     56        GAISLER_SDCTRL   = 0x009,
     57        GAISLER_APBUART  = 0x00c,
     58        GAISLER_IRQMP    = 0x00d,
     59        GAISLER_AHBRAM   = 0x00e,
     60        GAISLER_GPTIMER  = 0x011,
     61        GAISLER_PCITRG   = 0x012,
     62        GAISLER_PCISBRG  = 0x013,
     63        GAISLER_PCIFBRG  = 0x014,
     64        GAISLER_PCITRACE = 0x015,
     65        GAISLER_PCIDMA   = 0x016,
     66        GAISLER_AHBTRACE = 0x017,
     67        GAISLER_ETHDSU   = 0x018,
     68        GAISLER_PIOPORT  = 0x01a,
     69        GAISLER_AHBJTAG  = 0x01c,
     70        GAISLER_SPW      = 0x01f,
     71        GAISLER_ATACTRL  = 0x024,
     72        GAISLER_VGA      = 0x061,
     73        GAISLER_KBD      = 0x060,
     74        GAISLER_ETHMAC   = 0x01d,
     75        GAISLER_DDRSPA   = 0x025,
     76        GAISLER_EHCI     = 0x026,
     77        GAISLER_UHCI     = 0x027,
     78        GAISLER_SPW2     = 0x029,
     79        GAISLER_DDR2SPA  = 0x02e,
     80        GAISLER_AHBSTAT  = 0x052,
     81        GAISLER_FTMCTRL  = 0x054,
     82        ESA_MCTRL        = 0x00f,
    8383} amba_device_id_t;
    8484
     
    109109
    110110typedef struct {
    111         unsigned int addr: 12;
    112         unsigned int reserved: 2;
    113         unsigned int prefetchable: 1;
    114         unsigned int cacheable: 1;
    115         unsigned int mask: 12;
    116         unsigned int type: 4;
     111        unsigned int addr : 12;
     112        unsigned int reserved : 2;
     113        unsigned int prefetchable : 1;
     114        unsigned int cacheable : 1;
     115        unsigned int mask : 12;
     116        unsigned int type : 4;
    117117} __attribute__((packed)) ambapp_bar_t;
    118118
    119119typedef struct {
    120         unsigned int vendor_id: 8;
    121         unsigned int device_id: 24;
    122         unsigned int reserved: 2;
    123         unsigned int version: 5;
    124         unsigned int irq: 5;
     120        unsigned int vendor_id : 8;
     121        unsigned int device_id : 24;
     122        unsigned int reserved : 2;
     123        unsigned int version : 5;
     124        unsigned int irq : 5;
    125125        uint32_t user_defined[3];
    126126        ambapp_bar_t bar[4];
     
    128128
    129129typedef struct {
    130         unsigned int ram_read_ws: 1;
    131         unsigned int ram_write_ws: 1;
    132         unsigned int ram_width: 2;
    133         unsigned int rmw: 1;
    134         unsigned int rbrdy: 1;
     130        unsigned int ram_read_ws : 1;
     131        unsigned int ram_write_ws : 1;
     132        unsigned int ram_width : 2;
     133        unsigned int rmw : 1;
     134        unsigned int rbrdy : 1;
    135135        unsigned int : 1;
    136         unsigned int bank_size: 4;
    137         unsigned int si: 1;
    138         unsigned int se: 1;
     136        unsigned int bank_size : 4;
     137        unsigned int si : 1;
     138        unsigned int se : 1;
    139139        unsigned int : 1;
    140         unsigned int ms: 1;
     140        unsigned int ms : 1;
    141141        unsigned int : 1;
    142         unsigned int d64: 1;
    143         unsigned int sdram_cmd: 2;
    144         unsigned int sdram_colsz: 2;
    145         unsigned int sdram_banksz: 3;
    146         unsigned int tcas: 1;
    147         unsigned int trfc: 3;
    148         unsigned int trp: 1;
    149         unsigned int sdrf: 1;
     142        unsigned int d64 : 1;
     143        unsigned int sdram_cmd : 2;
     144        unsigned int sdram_colsz : 2;
     145        unsigned int sdram_banksz : 3;
     146        unsigned int tcas : 1;
     147        unsigned int trfc : 3;
     148        unsigned int trp : 1;
     149        unsigned int sdrf : 1;
    150150} __attribute__((packed)) mctrl_mcfg2_t;
    151151
    152 amba_device_t amba_devices[AMBAPP_MAX_DEVICES];
    153 int amba_devices_found;
    154 bool amba_fake;
    155 uintptr_t amba_uart_base;
     152extern amba_device_t amba_devices[AMBAPP_MAX_DEVICES];
     153extern int amba_devices_found;
     154extern bool amba_fake;
     155extern uintptr_t amba_uart_base;
    156156
    157 void ambapp_scan(void);
    158 bool ambapp_fake(void);
    159 void ambapp_qemu_fake_scan(void);
    160 void ambapp_print_devices(void);
    161 amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t);
     157extern void ambapp_scan(void);
     158extern bool ambapp_fake(void);
     159extern void ambapp_qemu_fake_scan(void);
     160extern void ambapp_print_devices(void);
     161extern amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t);
    162162
    163163#endif
  • boot/arch/sparc32/include/arch.h

    re47ed05 rf6f22cdb  
    3030#define BOOT_sparc32_ARCH_H
    3131
    32 #define PTL0_ENTRIES    256
    33 #define PTL0_SHIFT      24
    34 #define PTL0_SIZE       (1 << 24)
    35 #define PTL0_ENTRY_SIZE 4
     32#define PTL0_ENTRIES     256
     33#define PTL0_SHIFT       24
     34#define PTL0_SIZE        (1 << 24)
     35#define PTL0_ENTRY_SIZE  4
    3636
    3737/* ASI assignments: */
    38 #define ASI_CACHEMISS   0x01
    39 #define ASI_CACHECTRL   0x02
    40 #define ASI_MMUREGS     0x19
    41 #define ASI_MMUBYPASS   0x1c
     38#define ASI_CACHEMISS  0x01
     39#define ASI_CACHECTRL  0x02
     40#define ASI_MMUREGS    0x19
     41#define ASI_MMUBYPASS  0x1c
    4242
    4343/*
    44  * Address where the boot stage image starts (beginning of usable physical
    45  * memory).
     44 * Address where the boot stage image starts
     45 * (beginning of usable physical memory).
    4646 */
    47 #define BOOT_BASE       0x40000000
    48 #define BOOT_OFFSET     (BOOT_BASE + 0xa00000)
    4947
    50 #define PA_OFFSET 0x40000000
     48#define BOOT_BASE   0x40000000
     49#define BOOT_OFFSET (BOOT_BASE + 0xa00000)
     50
     51#define PA_OFFSET  0x40000000
    5152
    5253#ifndef __ASM__
     
    5657#endif
    5758
    58 
    5959#endif
    6060
  • boot/arch/sparc32/include/asm.h

    re47ed05 rf6f22cdb  
    3232#include <typedefs.h>
    3333
    34 static inline uint32_t asi_u32_read(int asi, uintptr_t va)
     34extern uintptr_t boot_ctx_table;
     35
     36static inline uint32_t asi_u32_read(unsigned int asi, uintptr_t va)
    3537{
    3638        uint32_t v;
    37 
     39       
    3840        asm volatile (
    3941                "lda [%[va]] %[asi], %[v]\n"
    4042                : [v] "=r" (v)
    4143                : [va] "r" (va),
    42                   [asi] "i" ((unsigned int) asi)
     44                  [asi] "i" (asi)
    4345        );
    4446       
     
    4648}
    4749
    48 static inline void asi_u32_write(int asi, uintptr_t va, uint32_t v)
     50static inline void asi_u32_write(unsigned int asi, uintptr_t va, uint32_t v)
    4951{
    5052        asm volatile (
     
    5254                :: [v] "r" (v),
    5355                   [va] "r" (va),
    54                    [asi] "i" ((unsigned int) asi)
     56                   [asi] "i" (asi)
    5557                : "memory"
    5658        );
    5759}
    5860
    59 extern void jump_to_kernel(void *entry, bootinfo_t *bootinfo);
     61extern void jump_to_kernel(void *, bootinfo_t *);
    6062
    6163#endif
  • boot/arch/sparc32/include/main.h

    re47ed05 rf6f22cdb  
    3535
    3636#ifndef BOOT_sparc32_MAIN_H
    37 #define BOOT_sparc2_MAIN_H
     37#define BOOT_sparc32_MAIN_H
    3838
    3939/** Address where characters to be printed are expected. */
    40 #define APBUART_SCONS_THR       0x80000100
    41 #define APBUART_SCONS_THR_MMU   0xb0000100
     40#define APBUART_SCONS_THR      0x80000100
     41#define APBUART_SCONS_THR_MMU  0xb0000100
    4242
    4343extern void bootstrap(void);
  • boot/arch/sparc32/include/mm.h

    re47ed05 rf6f22cdb  
    3939 */
    4040
    41 #ifndef BOOT_sparc32__MM_H
    42 #define BOOT_sparc32__MM_H
     41#ifndef BOOT_sparc32_MM_H
     42#define BOOT_sparc32_MM_H
    4343
    4444#include <typedefs.h>
    4545
    46 #define PAGE_SIZE       (1 << 12)
     46#define PAGE_SIZE  (1 << 12)
    4747
    4848typedef struct {
     
    5454
    5555typedef struct {
    56         unsigned int ppn: 24;
    57         unsigned int cacheable: 1;
    58         unsigned int modified: 1;
    59         unsigned int referenced: 1;
    60         unsigned int acc: 3;
    61         unsigned int et: 2;
     56        unsigned int ppn : 24;
     57        unsigned int cacheable : 1;
     58        unsigned int modified : 1;
     59        unsigned int referenced : 1;
     60        unsigned int acc : 3;
     61        unsigned int et : 2;
    6262} __attribute__((packed)) pte_t;
    6363
    6464extern pte_t boot_pt[PTL0_ENTRIES];
    6565
    66 void mmu_init(void);
     66extern void mmu_init(void);
    6767
    68 #define PTE_ET_DESCRIPTOR       1
    69 #define PTE_ET_ENTRY            2
    70 #define PTE_ACC_RWX             3
    71 #define MMU_CONTROL_EN          (1 << 0)
     68#define PTE_ET_DESCRIPTOR  1
     69#define PTE_ET_ENTRY       2
     70#define PTE_ACC_RWX        3
     71#define MMU_CONTROL_EN     (1 << 0)
    7272
    7373#endif
  • boot/arch/sparc32/src/ambapp.c

    re47ed05 rf6f22cdb  
    5050#include <errno.h>
    5151
    52 static void ambapp_scan_area(uintptr_t, int);
     52static void ambapp_scan_area(uintptr_t, unsigned int);
    5353
    5454void ambapp_scan()
    5555{
    5656        amba_fake = false;
    57 
     57       
    5858        /* Scan for AHB masters & slaves */
    5959        ambapp_scan_area(AMBAPP_AHBMASTER_AREA, 64);
    6060        ambapp_scan_area(AMBAPP_AHBSLAVE_AREA, 63);
    61 
     61       
    6262        /* Scan for APB slaves on APBMST */
    6363        amba_device_t *apbmst = ambapp_lookup_first(GAISLER, GAISLER_APBMST);
    6464        if (apbmst != NULL)
    6565                ambapp_scan_area(apbmst->bars[0].start, 16);
    66 
     66       
    6767        /* If we found nothing, fake device entries */
    6868        if (amba_devices_found == 0)
     
    7070}
    7171
    72 static void ambapp_scan_area(uintptr_t master_bar, int max_entries)
     72static void ambapp_scan_area(uintptr_t master_bar, unsigned int max_entries)
    7373{
    7474        ambapp_entry_t *entry = (ambapp_entry_t *) (master_bar | AMBAPP_CONF_AREA);
    75 
    76         for (int i = 0; i < max_entries; i++) {
     75       
     76        for (unsigned int i = 0; i < max_entries; i++) {
    7777                if (amba_devices_found == AMBAPP_MAX_DEVICES)
    7878                        return;
    79 
     79               
    8080                if (entry->vendor_id == 0xff)
    8181                        continue;
    82 
     82               
    8383                amba_device_t *device = &amba_devices[amba_devices_found];
    84                 device->vendor_id = (amba_vendor_id_t)entry->vendor_id;
    85         device->device_id = (amba_device_id_t)entry->device_id;
     84                device->vendor_id = (amba_vendor_id_t) entry->vendor_id;
     85                device->device_id = (amba_device_id_t) entry->device_id;
    8686                device->version = entry->version;
    8787                device->irq = entry->irq;
    88        
    89                 for (int bar = 0; bar < 4; bar++) {
     88               
     89                for (unsigned int bar = 0; bar < 4; bar++) {
    9090                        device->bars[bar].start = entry->bar[bar].addr << 20;
    9191                        device->bars[bar].size = entry->bar[bar].mask;
    92                         device->bars[bar].prefetchable = (bool)entry->bar[bar].prefetchable;
    93                         device->bars[bar].cacheable = (bool)entry->bar[bar].cacheable;
     92                        device->bars[bar].prefetchable = (bool) entry->bar[bar].prefetchable;
     93                        device->bars[bar].cacheable = (bool) entry->bar[bar].cacheable;
    9494                }
    95 
     95               
    9696                amba_devices_found++;
    9797        }
     
    107107        amba_devices[0].bars[0].start = 0x80000100;
    108108        amba_devices[0].bars[0].size = 0x100;
    109 
     109       
    110110        /* IRQMP */
    111111        amba_devices[1].vendor_id = GAISLER;
     
    115115        amba_devices[1].bars[0].start = 0x80000200;
    116116        amba_devices[1].bars[0].size = 0x100;
    117 
     117       
    118118        /* GPTIMER */
    119119        amba_devices[2].vendor_id = GAISLER;
     
    123123        amba_devices[2].bars[0].start = 0x80000300;
    124124        amba_devices[2].bars[0].size = 0x100;
    125 
     125       
    126126        amba_fake = true;
    127127        amba_devices_found = 3;
     
    136136{
    137137        printf("ABMA devices:\n");
    138 
    139         for (int i = 0; i < amba_devices_found; i++) {
     138       
     139        for (unsigned int i = 0; i < amba_devices_found; i++) {
    140140                amba_device_t *dev = &amba_devices[i];
    141                 printf("<%1x:%03x> at 0x%08x ", dev->vendor_id, dev->device_id, dev->bars[0].start);
     141               
     142                printf("<%1x:%03x> at 0x%08x ", dev->vendor_id, dev->device_id,
     143                    dev->bars[0].start);
     144               
    142145                if (dev->irq == -1)
    143146                        printf("\n");
     
    147150}
    148151
    149 amba_device_t *ambapp_lookup_first(amba_vendor_id_t vendor, amba_device_id_t device)
     152amba_device_t *ambapp_lookup_first(amba_vendor_id_t vendor,
     153    amba_device_id_t device)
    150154{
    151         for (int i = 0; i < amba_devices_found; i++) {
    152                 if (amba_devices[i].vendor_id == vendor &&
    153                     amba_devices[i].device_id == device)
     155        for (unsigned int i = 0; i < amba_devices_found; i++) {
     156                if ((amba_devices[i].vendor_id == vendor) &&
     157                    (amba_devices[i].device_id == device))
    154158                        return &amba_devices[i];
    155159        }
    156 
     160       
    157161        return NULL;
    158162}
  • boot/arch/sparc32/src/main.c

    re47ed05 rf6f22cdb  
    5252
    5353#define TOP2ADDR(top)  (((void *) PA2KA(BOOT_OFFSET)) + (top))
     54
    5455static bootinfo_t bootinfo;
    5556
     
    5859        /* Initialize AMBA P&P device list */
    5960        ambapp_scan();
    60 
    61         /* Look up for UART */
     61       
     62        /* Look for UART */
    6263        amba_device_t *uart = ambapp_lookup_first(GAISLER, GAISLER_APBUART);
    6364        amba_uart_base = uart->bars[0].start;
    6465        bootinfo.uart_base = amba_uart_base;
    6566        bootinfo.uart_irq = uart->irq;
    66 
    67         /* Look up for IRQMP */
     67       
     68        /* Look for IRQMP */
    6869        amba_device_t *irqmp = ambapp_lookup_first(GAISLER, GAISLER_IRQMP);
    6970        bootinfo.intc_base = irqmp->bars[0].start;
    70 
    71         /* Look up for timer */
     71       
     72        /* Look for timer */
    7273        amba_device_t *timer = ambapp_lookup_first(GAISLER, GAISLER_GPTIMER);
    7374        bootinfo.timer_base = timer->bars[0].start;
    7475        bootinfo.timer_irq = timer->irq;
    7576       
    76         /* Lookp up for memory controller and obtain memory size */
    77         if (ambapp_fake()) {
    78                 bootinfo.memsize = 64 * 1024 * 1024; // 64MB
    79         } else {
     77        /* Look for memory controller and obtain memory size */
     78        if (!ambapp_fake()) {
    8079                amba_device_t *mctrl = ambapp_lookup_first(ESA, ESA_MCTRL);
    81                 volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)(mctrl->bars[0].start + 0x4);
     80                volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)
     81                    (mctrl->bars[0].start + 0x4);
    8282                bootinfo.memsize = (1 << (13 + mcfg2->bank_size));
    83         }
     83        } else
     84                bootinfo.memsize = 64 * 1024 * 1024;
    8485       
    8586        /* Standard output is now initialized */
    8687        version_print();
    87 
     88       
    8889        for (size_t i = 0; i < COMPONENTS; i++) {
    8990                printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start,
     
    9192                    components[i].size);
    9293        }
    93 
     94       
    9495        ambapp_print_devices();
    95 
    96         printf("Memory size: %dMB\n", bootinfo.memsize >> 20);
    97 
     96       
     97        printf("Memory size: %u MB\n", bootinfo.memsize >> 20);
     98       
    9899        mmu_init();
    99 
     100       
    100101        void *dest[COMPONENTS];
    101102        size_t top = 0;
     
    116117               
    117118                dest[i] = TOP2ADDR(top);
    118 
     119               
    119120                top += components[i].inflated;
    120121                cnt++;
     
    128129                        printf("\n%s: Image too large to fit (%p >= %p), halting.\n",
    129130                            components[i].name, tail, dest[i - 1]);
    130                         for (;;);
     131                        halt();
    131132                }
    132133               
     
    137138                if (err != EOK) {
    138139                        printf("\n%s: Inflating error %d\n", components[i - 1].name, err);
    139                         for (;;);
     140                        halt();
    140141                }
    141142        }
    142 
     143       
    143144        printf("Booting the kernel ... \n");
    144145        jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo);
  • boot/arch/sparc32/src/mm.c

    re47ed05 rf6f22cdb  
    5050#include <inflate.h>
    5151
    52 #define OFF2SEC(_addr)  ((_addr) >> PTL0_SHIFT)
    53 #define SEC2OFF(_sec)   ((_sec) << PTL0_SHIFT)
     52#define OFF2SEC(_addr)  ((_addr) >> PTL0_SHIFT)
     53#define SEC2OFF(_sec)   ((_sec) << PTL0_SHIFT)
    5454
    5555static section_mapping_t mappings[] = {
     
    6060};
    6161
    62 extern uintptr_t boot_ctx_table;
    63 
    64 static void mmu_enable()
     62static void mmu_enable(void)
    6563{
    66         boot_ctx_table = ((uintptr_t)&boot_pt[0] >> 4) | PTE_ET_DESCRIPTOR;
    67 
     64        boot_ctx_table = ((uintptr_t) &boot_pt[0] >> 4) | PTE_ET_DESCRIPTOR;
     65       
    6866        /* Set Context Table Pointer register */
    69         asi_u32_write(ASI_MMUREGS, 0x100, ((uint32_t)&boot_ctx_table) >> 4);
    70 
     67        asi_u32_write(ASI_MMUREGS, 0x100, ((uint32_t) &boot_ctx_table) >> 4);
     68       
    7169        /* Select context 0 */
    7270        asi_u32_write(ASI_MMUREGS, 0x200, 0);
    73 
     71       
    7472        /* Enable MMU */
    7573        uint32_t cr = asi_u32_read(ASI_MMUREGS, 0x000);
     
    8583}
    8684
    87 void mmu_init()
     85void mmu_init(void)
    8886{
    8987        mmu_disable();
    90 
    91         for (int i = 0; mappings[i].size != 0; i++) {
    92                 int ptr = 0;
    93                 for (uint32_t sec = OFF2SEC(mappings[i].va); 
    94                      sec < OFF2SEC(mappings[i].va + mappings[i].size);
    95                      sec++) {
     88       
     89        for (unsigned int i = 0; mappings[i].size != 0; i++) {
     90                unsigned int ptr = 0;
     91                for (uint32_t sec = OFF2SEC(mappings[i].va);
     92                    sec < OFF2SEC(mappings[i].va + mappings[i].size);
     93                    sec++) {
    9694                        boot_pt[sec].ppn = ((mappings[i].pa + SEC2OFF(ptr++)) >> 12) & 0xffffff;
    9795                        boot_pt[sec].cacheable = mappings[i].cacheable;
     
    10098                }
    10199        }
    102 
     100       
    103101        mmu_enable();
    104102}
  • boot/arch/sparc32/src/putchar.c

    re47ed05 rf6f22cdb  
    4747/** Send a byte to the LEON3 serial console.
    4848 *
    49  * @param byte          Byte to send.
     49 * @param byte Byte to send.
     50 *
    5051 */
    5152static void scons_sendb(uint8_t byte)
     
    5657/** Display a character
    5758 *
    58  * @param ch    Character to display
     59 * @param ch Character to display
     60 *
    5961 */
    6062void putchar(const wchar_t ch)
     
    6264        if (ch == '\n')
    6365                scons_sendb('\r');
    64 
     66       
    6567        if (ascii_check(ch))
    6668                scons_sendb((uint8_t) ch);
Note: See TracChangeset for help on using the changeset viewer.