Changeset 3622 for trunk

Show
Ignore:
Timestamp:
09/30/08 17:02:40 (7 weeks ago)
Author:
uwe
Message:

Coding-style fixes and simplifications for the ASUS A8N-E (trivial).
The only non-cosmetic change is s/A8NE/A8N-E/ for the board name.
This is build-tested by me.

Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Uwe Hermann <uwe@…>

Location:
trunk/coreboot-v2
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/mainboard/asus/a8n_e/Config.lb

    r3079 r3622  
    2222## 
    2323 
    24 ## 
    25 ## Compute the location and size of where this firmware image 
    26 ## (coreboot plus bootloader) will live in the boot rom chip. 
    27 ## 
    2824if USE_FAILOVER_IMAGE 
    2925        default ROM_SECTION_SIZE   = FAILOVER_SIZE 
     
    3834        end 
    3935end 
    40  
    41 ## 
    42 ## Compute the start location and size size of the coreboot bootloader. 
    43 ## 
    4436default PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE) 
    4537default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1) 
    46  
    47 ## 
    48 ## Compute where this copy of coreboot will start in the boot ROM. 
    49 ## 
    50 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE ) 
    51  
    52 ## 
    53 ## Compute a range of ROM that can be cached to speed up coreboot 
    54 ## execution speed. 
    55 ## 
    56 ## XIP_ROM_SIZE must be a power of 2 (here 64 Kbyte) 
    57 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE 
    58 ## 
    59 default XIP_ROM_SIZE = (64 * 1024) 
    60  
     38default _ROMBASE = (CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE) 
     39# XIP_ROM_SIZE must be a power of 2. 
     40# XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE. 
     41default XIP_ROM_SIZE = 64 * 1024 
    6142if USE_FAILOVER_IMAGE 
    6243        default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE) 
     
    6849        end 
    6950end 
    70  
    7151arch i386 end 
    72  
    73 ## 
    74 ## Build the objects we have code for in this directory. 
    75 ## 
    76  
    7752driver mainboard.o 
    78  
    79 #dir /drivers/ati/ragexl 
    80  
    8153# Needed by irq_tables and mptable and acpi_tables. 
    8254object get_bus_conf.o 
    83  
    84 if HAVE_MP_TABLE 
    85         object mptable.o 
    86 end 
    87  
    88 if HAVE_PIRQ_TABLE 
    89         object irq_tables.o 
    90 end 
    91  
     55if HAVE_MP_TABLE object mptable.o end 
     56if HAVE_PIRQ_TABLE object irq_tables.o end 
    9257if USE_DCACHE_RAM 
    9358        if CONFIG_USE_INIT 
     
    10570        end 
    10671end 
    107  
    108 ## 
    109 ## Build our 16 bit and 32 bit coreboot entry code. 
    110 ## 
    11172if HAVE_FAILOVER_BOOT 
    11273        if USE_FAILOVER_IMAGE 
     
    12081        end 
    12182end 
    122  
    12383mainboardinit cpu/x86/32bit/entry32.inc 
    124  
    12584if USE_DCACHE_RAM 
    12685        if CONFIG_USE_INIT 
     
    12988        end 
    13089end 
    131  
    132 ## 
    133 ## Build our reset vector (this is where coreboot is entered). 
    134 ## 
    13590if HAVE_FAILOVER_BOOT 
    13691        if USE_FAILOVER_IMAGE 
     
    150105        end 
    151106end 
    152  
    153 if USE_DCACHE_RAM 
    154 else 
    155         ### Should this be in the northbridge code? 
     107if USE_DCACHE_RAM 
     108else 
    156109        mainboardinit arch/i386/lib/cpu_reset.inc 
    157110end 
    158  
    159 ## 
    160 ## Include an ID string (for safe flashing). 
    161 ## 
     111# Include an ID string (for safe flashing). 
    162112mainboardinit southbridge/nvidia/ck804/id.inc 
    163113ldscript /southbridge/nvidia/ck804/id.lds 
    164  
    165 ## 
    166 ## ROMSTRAP table for CK804 
    167 ## 
     114# ROMSTRAP table for CK804. 
    168115if HAVE_FAILOVER_BOOT 
    169116        if USE_FAILOVER_IMAGE 
     
    177124        end 
    178125end 
    179  
    180 if USE_DCACHE_RAM 
    181         ## 
    182         ## Setup Cache-As-Ram 
    183         ## 
     126if USE_DCACHE_RAM 
    184127        mainboardinit cpu/amd/car/cache_as_ram.inc 
    185128end 
    186  
    187  
    188 ### 
    189 ### This is the early phase of coreboot startup. 
    190 ### Things are delicate and we test to see if we should 
    191 ### failover to another image. 
    192 ### 
    193129if HAVE_FAILOVER_BOOT 
    194130        if USE_FAILOVER_IMAGE 
     
    204140        end 
    205141end 
    206  
    207 ### 
    208 ### O.k. We aren't just an intermediary anymore! 
    209 ### 
    210  
    211 ## 
    212 ## Setup RAM 
    213 ## 
    214142if USE_DCACHE_RAM 
    215143        if CONFIG_USE_INIT 
     
    219147        end 
    220148end 
    221  
    222 ## 
    223 ## Include the secondary configuration files 
    224 ## 
    225149if CONFIG_CHIP_NAME 
    226150        config chip.h 
  • trunk/coreboot-v2/src/mainboard/asus/a8n_e/Options.lb

    r3053 r3622  
    8181uses CONFIG_PCI_ROM_RUN 
    8282uses HW_MEM_HOLE_SIZEK 
    83  
    8483uses USE_DCACHE_RAM 
    8584uses DCACHE_RAM_BASE 
     
    9089uses MEM_TRAIN_SEQ 
    9190uses WAIT_BEFORE_CPUS_INIT 
    92  
    9391uses ENABLE_APIC_EXT_ID 
    9492uses APIC_ID_OFFSET 
    9593uses LIFT_BSP_APIC_ID 
    96  
    9794uses CONFIG_PCI_64BIT_PREF_MEM 
    98  
    9995uses HT_CHAIN_UNITID_BASE 
    10096uses HT_CHAIN_END_UNITID_BASE 
    10197uses SB_HT_CHAIN_ON_BUS0 
    10298uses SB_HT_CHAIN_UNITID_OFFSET_ONLY 
    103  
    10499uses CONFIG_LB_MEM_TOPK 
    105100 
     101default ROM_SIZE = 512 * 1024 
     102default ROM_IMAGE_SIZE = 64 * 1024 
     103default FALLBACK_SIZE = 252 * 1024 
     104default FAILOVER_SIZE = 4 * 1024 
     105default HAVE_FALLBACK_BOOT = 1 
     106default HAVE_FAILOVER_BOOT = 1 
     107default HAVE_HARD_RESET = 1 
     108default HAVE_PIRQ_TABLE = 1 
     109default IRQ_SLOT_COUNT = 13 
     110default HAVE_MP_TABLE = 1 
     111default HAVE_OPTION_TABLE = 1 
     112# Move the default coreboot CMOS range off of AMD RTC registers. 
     113default LB_CKS_RANGE_START = 49 
     114default LB_CKS_RANGE_END = 122 
     115default LB_CKS_LOC = 123 
     116# SMP support (only worry about 2 micro processors). 
     117default CONFIG_SMP = 1 
     118default CONFIG_MAX_CPUS = 2 
     119default CONFIG_MAX_PHYSICAL_CPUS = 1 
     120default CONFIG_LOGICAL_CPUS = 1 
     121# 1G memory hole. 
     122default HW_MEM_HOLE_SIZEK = 0x100000 
     123# HT Unit ID offset, default is 1, the typical one. 
     124default HT_CHAIN_UNITID_BASE = 0 
     125# Real SB Unit ID, default is 0x20, mean don't touch it at last. 
     126# default HT_CHAIN_END_UNITID_BASE = 0x10 
     127# Make the SB HT chain on bus 0, default is not (0). 
     128default SB_HT_CHAIN_ON_BUS0 = 2 
     129# Only offset for SB chain?, default is yes(1). 
     130default SB_HT_CHAIN_UNITID_OFFSET_ONLY = 0 
     131# default CONFIG_CONSOLE_BTEXT = 1              # BTEXT console 
     132default CONFIG_CONSOLE_VGA = 1                  # For VGA console 
     133default CONFIG_PCI_ROM_RUN = 1                  # For VGA console 
     134default USE_DCACHE_RAM = 1 
     135default DCACHE_RAM_BASE = 0xc8000 
     136default DCACHE_RAM_SIZE = 32 * 1024 
     137default DCACHE_RAM_GLOBAL_VAR_SIZE = 4 * 1024 
     138default CONFIG_USE_INIT = 0 
     139default CONFIG_AP_CODE_IN_CAR = 0 
     140default MEM_TRAIN_SEQ = 2 
     141default WAIT_BEFORE_CPUS_INIT = 0 
     142# default ENABLE_APIC_EXT_ID = 0 
     143# default APIC_ID_OFFSET = 0x10 
     144# default LIFT_BSP_APIC_ID = 0 
     145# default CONFIG_PCI_64BIT_PREF_MEM = 1 
     146default CONFIG_IOAPIC = 1 
     147default MAINBOARD_PART_NUMBER = "A8N-E" 
     148default MAINBOARD_VENDOR = "ASUS" 
     149default MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID = 0x10f1 
     150default MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID = 0x2891 
     151default STACK_SIZE = 8 * 1024 
     152default HEAP_SIZE = 16 * 1024 
     153# Only use the option table in a normal image. 
     154default USE_OPTION_TABLE = (!USE_FALLBACK_IMAGE) && (!USE_FAILOVER_IMAGE) 
     155default _RAMBASE = 0x00004000 
     156default CONFIG_ROM_PAYLOAD = 1 
     157default CC = "$(CROSS_COMPILE)gcc -m32" 
     158default HOSTCC = "gcc" 
     159default CONFIG_GDB_STUB = 0 
     160default CONFIG_CONSOLE_SERIAL8250 = 1 
     161default TTYS0_BAUD = 115200 
     162default TTYS0_BASE = 0x3f8 
     163default TTYS0_LCS = 0x3 
     164default DEFAULT_CONSOLE_LOGLEVEL = 8 
     165default MAXIMUM_CONSOLE_LOGLEVEL = 8 
     166default MAINBOARD_POWER_ON_AFTER_POWER_FAIL = "MAINBOARD_POWER_ON" 
    106167 
    107 ## ROM_SIZE is the size of boot ROM that this board will use. 
    108 ## ---> 512 Kbytes  
    109 default ROM_SIZE=(512*1024) 
    110  
    111 ## 
    112 ## FALLBACK_SIZE is the amount of the ROM the complete fallback image will use 
    113 ## 
    114 default FALLBACK_SIZE=(252*1024) 
    115  
    116 #FAILOVER: 4K 
    117 default FAILOVER_SIZE=(4*1024) 
    118  
    119 ### 
    120 ### Build options 
    121 ### 
    122  
    123 ## 
    124 ## Build code for the fallback boot 
    125 ## 
    126 default HAVE_FALLBACK_BOOT=1 
    127 default HAVE_FAILOVER_BOOT=1 
    128  
    129 ## 
    130 ## Build code to reset the motherboard from coreboot 
    131 ## 
    132 default HAVE_HARD_RESET=1 
    133  
    134 ## 
    135 ## Build code to export a programmable irq routing table 
    136 ## 
    137 default HAVE_PIRQ_TABLE=1 
    138 default IRQ_SLOT_COUNT=13 
    139  
    140 ## 
    141 ## Build code to export an x86 MP table 
    142 ## Useful for specifying IRQ routing values 
    143 ## 
    144 default HAVE_MP_TABLE=1 
    145  
    146 ## 
    147 ## Build code to export a CMOS option table 
    148 ## 
    149 default HAVE_OPTION_TABLE=1 
    150  
    151 ## 
    152 ## Move the default coreboot cmos range off of AMD RTC registers 
    153 ## 
    154 default LB_CKS_RANGE_START=49 
    155 default LB_CKS_RANGE_END=122 
    156 default LB_CKS_LOC=123 
    157  
    158 ## 
    159 ## Build code for SMP support 
    160 ## Only worry about 2 micro processors 
    161 ## 
    162 default CONFIG_SMP=1 
    163 default CONFIG_MAX_CPUS=2 
    164 default CONFIG_MAX_PHYSICAL_CPUS=1 
    165 default CONFIG_LOGICAL_CPUS=1 
    166  
    167 #1G memory hole 
    168 default HW_MEM_HOLE_SIZEK=0x100000 
    169  
    170 ##HT Unit ID offset, default is 1, the typical one 
    171 default HT_CHAIN_UNITID_BASE=0 
    172  
    173 ##real SB Unit ID, default is 0x20, mean dont touch it at last 
    174 #default HT_CHAIN_END_UNITID_BASE=0x10 
    175  
    176 #make the SB HT chain on bus 0, default is not (0) 
    177 default SB_HT_CHAIN_ON_BUS0=2 
    178  
    179 ##only offset for SB chain?, default is yes(1) 
    180 default SB_HT_CHAIN_UNITID_OFFSET_ONLY=0 
    181  
    182 #BTEXT Console 
    183 #default CONFIG_CONSOLE_BTEXT=1 
    184  
    185 #VGA Console 
    186 default CONFIG_CONSOLE_VGA=1 
    187 default CONFIG_PCI_ROM_RUN=1 
    188  
    189 ## 
    190 ## enable CACHE_AS_RAM specifics 
    191 ## 
    192 default USE_DCACHE_RAM=1 
    193 #default DCACHE_RAM_BASE=0xcf000 
    194 #default DCACHE_RAM_SIZE=0x1000 
    195 default DCACHE_RAM_BASE=0xc8000 
    196 default DCACHE_RAM_SIZE=0x08000 
    197 default DCACHE_RAM_GLOBAL_VAR_SIZE=0x01000 
    198 default CONFIG_USE_INIT=0 
    199  
    200 default CONFIG_AP_CODE_IN_CAR=0 
    201 default MEM_TRAIN_SEQ=2 
    202 default WAIT_BEFORE_CPUS_INIT=0 
    203  
    204 ## APIC stuff 
    205 #default ENABLE_APIC_EXT_ID=0 
    206 #default APIC_ID_OFFSET=0x10 
    207 #default LIFT_BSP_APIC_ID=0 
    208  
    209  
    210 #default CONFIG_PCI_64BIT_PREF_MEM=1 
    211  
    212 ## 
    213 ## Build code to setup a generic IOAPIC 
    214 ## 
    215 default CONFIG_IOAPIC=1 
    216  
    217 ## 
    218 ## Clean up the motherboard id strings 
    219 ## 
    220 default MAINBOARD_PART_NUMBER="A8NE" 
    221 default MAINBOARD_VENDOR="ASUS" 
    222 default MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID=0x10f1 
    223 default MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID=0x2891 
    224  
    225 ### 
    226 ### coreboot layout values 
    227 ### 
    228  
    229 ## ROM_IMAGE_SIZE is the amount of space to allow coreboot to occupy. 
    230 default ROM_IMAGE_SIZE = (64*1024) 
    231 #65536 
    232  
    233 ## 
    234 ## Use a small 8K stack 
    235 ## 
    236 default STACK_SIZE=0x2000 
    237  
    238 ## 
    239 ## Use a small 16K heap 
    240 ## 
    241 default HEAP_SIZE=0x4000 
    242  
    243 ## 
    244 ## Only use the option table in a normal image 
    245 ## 
    246 #efault USE_OPTION_TABLE = !USE_FALLBACK_IMAGE 
    247 default USE_OPTION_TABLE = (!USE_FALLBACK_IMAGE) && (!USE_FAILOVER_IMAGE ) 
    248  
    249 ## 
    250 ## Coreboot C code runs at this location in RAM 
    251 ## 
    252 default _RAMBASE=0x00004000 
    253  
    254 ## 
    255 ## Load the payload from the ROM 
    256 ## 
    257 default CONFIG_ROM_PAYLOAD = 1 
    258  
    259 ### 
    260 ### Defaults of options that you may want to override in the target config file 
    261 ###  
    262  
    263 ## 
    264 ## The default compiler 
    265 ## 
    266 default CC="$(CROSS_COMPILE)gcc -m32" 
    267 default HOSTCC="gcc" 
    268  
    269 ## 
    270 ## Disable the gdb stub by default 
    271 ##  
    272 default CONFIG_GDB_STUB=0 
    273  
    274 ## 
    275 ## The Serial Console 
    276 ## 
    277  
    278 # To Enable the Serial Console 
    279 default CONFIG_CONSOLE_SERIAL8250=1 
    280  
    281 ## Select the serial console baud rate 
    282 default TTYS0_BAUD=115200 
    283 #default TTYS0_BAUD=57600 
    284 #default TTYS0_BAUD=38400 
    285 #default TTYS0_BAUD=19200 
    286 #default TTYS0_BAUD=9600 
    287 #default TTYS0_BAUD=4800 
    288 #default TTYS0_BAUD=2400 
    289 #default TTYS0_BAUD=1200 
    290  
    291 # Select the serial console base port 
    292 default TTYS0_BASE=0x3f8 
    293  
    294 # Select the serial protocol 
    295 # This defaults to 8 data bits, 1 stop bit, and no parity 
    296 default TTYS0_LCS=0x3 
    297  
    298 ## 
    299 ### Select the coreboot loglevel 
    300 ## 
    301 ## EMERG      1   system is unusable                
    302 ## ALERT      2   action must be taken immediately  
    303 ## CRIT       3   critical conditions               
    304 ## ERR        4   error conditions                  
    305 ## WARNING    5   warning conditions                
    306 ## NOTICE     6   normal but significant condition  
    307 ## INFO       7   informational                     
    308 ## DEBUG      8   debug-level messages              
    309 ## SPEW       9   Way too many details              
    310  
    311 ## Request this level of debugging output 
    312 default  DEFAULT_CONSOLE_LOGLEVEL=8 
    313 ## At a maximum only compile in this level of debugging 
    314 default  MAXIMUM_CONSOLE_LOGLEVEL=8 
    315  
    316 ## 
    317 ## Select power on after power fail setting 
    318 default MAINBOARD_POWER_ON_AFTER_POWER_FAIL="MAINBOARD_POWER_ON" 
    319  
    320 ### End Options.lb 
    321168end 
  • trunk/coreboot-v2/src/mainboard/asus/a8n_e/cache_as_ram_auto.c

    r3594 r3622  
    7777static void memreset_setup(void) 
    7878{ 
    79         /* FIXME: Nothing to do? */ 
     79        /* Nothing to do. */ 
    8080} 
    8181 
    8282static void memreset(int controllers, const struct mem_controller *ctrl) 
    8383{ 
    84         /* FIXME: Nothing to do? */ 
     84        /* Nothing to do. */ 
    8585} 
    8686 
    8787static inline void activate_spd_rom(const struct mem_controller *ctrl) 
    8888{ 
    89         /* FIXME: Nothing to do? */ 
     89        /* Nothing to do. */ 
    9090} 
    9191 
     
    124124        /* LPC Positive Decode 0 */ 
    125125        dword = pci_read_config32(PCI_DEV(0, CK804_DEVN_BASE + 1, 0), 0xa0); 
    126         /* Serial 0, Serial 1 */ 
    127         dword |= (1 << 0) | (1 << 1); 
     126        dword |= (1 << 0) | (1 << 1);   /* Serial 0, Serial 1 */ 
    128127        pci_write_config32(PCI_DEV(0, CK804_DEVN_BASE + 1, 0), 0xa0, dword); 
    129128} 
     
    213212 
    214213        int needs_reset; 
    215         unsigned bsp_apicid = 0; 
    216  
     214        unsigned nodes, bsp_apicid = 0; 
    217215        struct mem_controller ctrl[8]; 
    218         unsigned nodes; 
    219  
    220         if (bist == 0) { 
     216 
     217        if (bist == 0) 
    221218                bsp_apicid = init_cpus(cpu_init_detectedx); 
    222         } 
    223219 
    224220        it8712f_24mhz_clkin(); 
     
    238234        wait_all_core0_started(); 
    239235#if CONFIG_LOGICAL_CPUS==1 
    240         // It is said that we should start core1 after all core0 launched 
     236        /* It is said that we should start core1 after all core0 launched. */ 
    241237        start_other_cores(); 
    242238        wait_all_other_cores_started(bsp_apicid); 
     
    244240 
    245241        needs_reset |= ht_setup_chains_x(); 
    246  
    247242        needs_reset |= ck804_early_setup_x(); 
    248243 
     
    255250 
    256251        nodes = get_nodes(); 
    257         //It's the time to set ctrl now; 
     252        /* It's the time to set ctrl now. */ 
    258253        fill_mem_ctrl(nodes, ctrl, spd_addr); 
    259254 
  • trunk/coreboot-v2/src/mainboard/asus/a8n_e/get_bus_conf.c

    r3052 r3622  
    2727#include <string.h> 
    2828#include <stdint.h> 
     29#include <stdlib.h> 
    2930#if CONFIG_LOGICAL_CPUS == 1 
    3031#include <cpu/amd/dualcore.h> 
    3132#endif 
    32  
    3333#include <cpu/amd/amdk8_sysconf.h> 
    3434 
    35 /* Global variables for MB layouts and these will be shared by irqtable, 
     35/* 
     36 * Global variables for MB layouts and these will be shared by irqtable, 
    3637 * mptable and acpi_tables. 
    3738 */ 
     
    4142unsigned apicid_ck804; 
    4243 
    43 unsigned pci1234x[] = {         //Here you only need to set value in pci1234 for HT-IO that could be installed or not 
    44         //You may need to preset pci1234 for HTIO board, please refer to src/northbridge/amd/amdk8/get_sblk_pci1234.c for detail 
    45         0x0000ff0,              //no HTIO for a8n_e 
     44/* 
     45 * Here you only need to set value in pci1234 for HT-IO that could be installed 
     46 * or not. You may need to preset pci1234 for HT-IO board, please refer to 
     47 * src/northbridge/amd/amdk8/get_sblk_pci1234.c for details. 
     48 */ 
     49unsigned pci1234x[] = { 
     50        0x0000ff0,              /* No HTIO for A8N-E */ 
    4651}; 
    47 unsigned hcdnx[] = {            //HT Chain device num, actually it is unit id base of every ht device in chain, assume every chain only have 4 ht device at most 
    48         0x20202020,             //a8n_e has only one ht-chain  
     52 
     53/* 
     54 * HT Chain device num, actually it is unit id base of every ht device in 
     55 * chain, assume every chain only have 4 ht device at most. 
     56 */ 
     57unsigned hcdnx[] = { 
     58        0x20202020,             /* A8N-E has only one ht-chain */ 
    4959}; 
     60 
    5061unsigned bus_type[256]; 
    5162 
     
    5667void get_bus_conf(void) 
    5768{ 
    58         unsigned apicid_base; 
    59  
     69        unsigned apicid_base, sbdn; 
    6070        device_t dev; 
    61         unsigned sbdn; 
    6271        int i, j; 
    6372 
    6473        if (get_bus_conf_done == 1) 
    65                 return;         //do it only once 
     74                return;         /* Do it only once. */ 
    6675 
    6776        get_bus_conf_done = 1; 
    6877 
    69         sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]); 
    70         sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]); 
     78        /* FIXME: Is this really needed twice? */ 
     79        sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); 
     80        sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); 
    7181        for (i = 0; i < sysconf.hc_possible_num; i++) { 
    7282                sysconf.pci1234[i] = pci1234x[i]; 
     
    7686        get_sblk_pci1234(); 
    7787 
    78         sysconf.sbdn = (sysconf.hcdn[0] & 0xff);        // first byte of first chain 
     88        sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain 
    7989        sbdn = sysconf.sbdn; 
    8090 
    81         for (i = 0; i < 6; i++) { 
     91        for (i = 0; i < 6; i++) 
    8292                bus_ck804[i] = 0; 
    83         } 
     93        for (i = 0; i < 256; i++) 
     94                bus_type[i] = 0; 
    8495 
    85         for (i = 0; i < 256; i++) { 
    86                 bus_type[i] = 0; 
    87         } 
    88  
    89         bus_type[0] = 1;        //pci 
     96        bus_type[0] = 1;        /* PCI */ 
    9097 
    9198        bus_ck804[0] = (sysconf.pci1234[0] >> 16) & 0xff; 
     
    108115 
    109116        for (i = 2; i < 6; i++) { 
    110                 dev = 
    111                     dev_find_slot(bus_ck804[0], 
    112                                   PCI_DEVFN(sbdn + 0x0b + i - 2, 0)); 
     117                dev = dev_find_slot(bus_ck804[0], 
     118                                    PCI_DEVFN(sbdn + 0x0b + i - 2, 0)); 
    113119                if (dev) { 
    114120                        bus_ck804[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); 
     
    118124                                bus_type[j] = 1; 
    119125                } else { 
    120                         printk_debug 
    121                             ("ERROR - could not find PCI %02x:%02x.0, using defaults\n", 
     126                        printk_debug("ERROR - could not find PCI %02x:%02x.0, using defaults\n", 
    122127                             bus_ck804[0], sbdn + 0x0b + i - 2); 
    123128                        bus_isa = bus_ck804[i - 1] + 1; 
     
    125130        } 
    126131 
    127 /*I/O APICs:    APIC ID Version State           Address*/ 
    128132#if CONFIG_LOGICAL_CPUS==1 
    129133        apicid_base = get_apicid_base(3); 
  • trunk/coreboot-v2/src/mainboard/asus/a8n_e/irq_tables.c

    r3052 r3622  
    2121 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA 
    2222 */ 
    23  
    24 /* Documentation at: http://www.microsoft.com/hwdev/busbios/PCIIRQ.HTM */ 
    2523 
    2624#include <console/console.h> 
     
    6462unsigned long write_pirq_routing_table(unsigned long addr) 
    6563{ 
    66  
    6764        struct irq_routing_table *pirq; 
    6865        struct irq_info *pirq_info; 
    69         unsigned slot_num; 
    70         uint8_t *v; 
     66        unsigned slot_num, sbdn; 
     67        uint8_t *v, sum = 0; 
     68        int i; 
    7169 
    72         uint8_t sum = 0; 
    73         int i; 
    74         unsigned sbdn; 
    75  
    76         /* get_bus_conf() will find out all bus num and apic that share with  
    77          * mptable.c and mptable.c 
     70        /* get_bus_conf() will find out all bus num and APIC that share with  
     71         * mptable.c and mptable.c. 
    7872         */ 
    7973        get_bus_conf(); 
     
    8478        addr &= ~15; 
    8579 
    86         /* This table must be betweeen 0xf0000 & 0x100000 */ 
     80        /* This table must be betweeen 0xf0000 & 0x100000. */ 
    8781        printk_info("Writing IRQ routing tables to 0x%x...", addr); 
    8882 
    8983        pirq = (void *)(addr); 
    90         v = (uint8_t *) (addr); 
     84        v = (uint8_t *)(addr); 
    9185 
    9286        pirq->signature = PIRQ_SIGNATURE; 
    9387        pirq->version = PIRQ_VERSION; 
    94  
    9588        pirq->rtr_bus = bus_ck804[0]; 
    9689        pirq-&