Changeset 3644 for trunk/coreboot-v2

Show
Ignore:
Timestamp:
10/09/08 19:08:32 (3 months ago)
Author:
uwe
Message:

Indent-based + manual cleanups for CN700 (trivial). As this will be ported
to v3 sooner or later we cleanup _now_, so we don't have to do it twice.

  • Whitespace, coding style improvements.
  • Fix a few typos.
  • Add a missing #endif in raminit.h.
  • Drop an unused variable.

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

Location:
trunk/coreboot-v2/src/northbridge/via/cn700
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/northbridge/via/cn700/agp.c

    r3113 r3644  
    3333{ 
    3434        u32 reg32; 
    35          
    36         /* Some of this may not be necessary, 
    37          * it should be handled by the OS */ 
     35 
     36        /* Some of this may not be necessary (should be handled by the OS). */ 
    3837        printk_debug("Enabling AGP.\n"); 
    39          
    40         /* Allow R/W access to AGP registers */ 
     38 
     39        /* Allow R/W access to AGP registers. */ 
    4140        pci_write_config8(dev, 0x4d, 0x15); 
    42                  
    43         /* Setup PCI latency timer */ 
     41 
     42        /* Setup PCI latency timer. */ 
    4443        pci_write_config8(dev, 0xd, 0x8); 
    45          
    46         /* Set to AGP 3.0 Mode, which should theoretically render the rest of 
    47          * the registers set here pointless */ 
     44 
     45        /* 
     46         * Set to AGP 3.0 Mode, which should theoretically render the rest of 
     47         * the registers set here pointless. 
     48         */ 
    4849        pci_write_config8(dev, 0x84, 0xb); 
    49          
     50 
    5051        /* AGP Request Queue Size */ 
    5152        pci_write_config8(dev, 0x4a, 0x1f); 
    52         /* AGP Hardware Support (default 0xc4) 
     53 
     54        /* 
     55         * AGP Hardware Support (default 0xc4) 
    5356         * 7: AGP SBA Enable (1 to Enable) 
    5457         * 6: AGP Enable 
     
    5861         * 2: AGP4X Mode Enable 
    5962         * 1: AGP2X Mode Enable 
    60          * 0: AGP1X Mode Enable */ 
     63         * 0: AGP1X Mode Enable 
     64         */ 
    6165        pci_write_config8(dev, 0x4b, 0xc4); 
    62          
     66 
    6367        /* Enable AGP Backdoor */ 
    6468        pci_write_config8(dev, 0xb5, 0x03); 
    65                  
    66         /* Set aperture to 32MB */ 
    67         /* TODO: Use config option, explain how it works */ 
     69 
     70        /* Set aperture to 32 MB. */ 
     71        /* TODO: Use config option, explain how it works. */ 
    6872        pci_write_config32(dev, 0x94, 0x00010f38); 
    69         /* Set GART Table Base Address (31:12) */ 
     73        /* Set GART Table Base Address (31:12). */ 
    7074        pci_write_config32(dev, 0x98, (0x1558 << 12)); 
    71         /* Set AGP Aperture Base */ 
     75        /* Set AGP Aperture Base. */ 
    7276        pci_write_config32(dev, 0x10, 0xf8000008); 
    7377 
    74         /* Enable CPU/PMSTR GART Access */ 
     78        /* Enable CPU/PMSTR GART Access. */ 
    7579        reg32 = pci_read_config8(dev, 0xbf); 
    7680        reg32 |= 0x80; 
    7781        pci_write_config8(dev, 0xbf, reg32); 
    78          
     82 
    7983        /* Enable AGP Aperture. */ 
    8084        reg32 = pci_read_config32(dev, 0x94); 
     
    8589        pci_write_config8(dev, 0xbc, 0x21); 
    8690        pci_write_config8(dev, 0xbd, 0xd2); 
    87          
    88         /* AGP Pad, driving strength, and delay control */ 
    89         /* All this should be constant, seeing as the  
    90          * VGA controller is onboard */ 
     91 
     92        /* 
     93         * AGP Pad, driving strength, and delay control. All this should be 
     94         * constant, seeing as the VGA controller is onboard. 
     95         */ 
    9196        pci_write_config8(dev, 0x40, 0xc7); 
    9297        pci_write_config8(dev, 0x41, 0xdb); 
     
    9499        pci_write_config8(dev, 0x43, 0xdb); 
    95100        pci_write_config8(dev, 0x44, 0x24); 
    96          
     101 
    97102        /* AGPC CKG Control */ 
    98103        pci_write_config8(dev, 0xc0, 0x02); 
     
    109114 
    110115static const struct pci_driver agp_driver __pci_driver = { 
    111         .ops = &agp_operations, 
     116        .ops    = &agp_operations, 
    112117        .vendor = PCI_VENDOR_ID_VIA, 
    113118        .device = PCI_DEVICE_ID_VIA_CN700_AGP, 
    114119}; 
    115120 
    116 /* This is the AGP 3.0 "bridge" @Bus 0 Device 1 Func 0. When using AGP 3.0, the 
    117 config in this device takes presidence. We configure both just to be safe. */ 
     121/* 
     122 * This is the AGP 3.0 "bridge" @Bus 0 Device 1 Func 0. When using AGP 3.0, the 
     123 * config in this device takes presidence. We configure both just to be safe. 
     124 */ 
    118125static void agp_bridge_init(device_t dev) 
    119126{ 
    120         printk_debug("Setting up AGP Bridge device\n"); 
     127        printk_debug("Setting up AGP bridge device\n"); 
     128 
    121129        pci_write_config16(dev, 0x4, 0x0007); 
    122130 
     
    125133        /* Subordinate Bus Number */ 
    126134        pci_write_config8(dev, 0x1a, 0x01); 
    127         /* IO Base */ 
     135        /* I/O Base */ 
    128136        pci_write_config8(dev, 0x1c, 0xd0); 
    129         /* IO Limit */ 
     137        /* I/O Limit */ 
    130138        pci_write_config8(dev, 0x1d, 0xd0); 
    131          
     139 
    132140        /* Memory Base */ 
    133141        pci_write_config16(dev, 0x20, 0xfb00); 
     
    160168 
    161169static const struct pci_driver agp_bridge_driver __pci_driver = { 
    162         .ops = &agp_bridge_operations, 
     170        .ops    = &agp_bridge_operations, 
    163171        .vendor = PCI_VENDOR_ID_VIA, 
    164172        .device = PCI_DEVICE_ID_VIA_CN700_BRIDGE, 
  • trunk/coreboot-v2/src/northbridge/via/cn700/chip.h

    r3113 r3644  
    1919 */ 
    2020 
    21 struct northbridge_via_cn700_config 
    22 { 
     21struct northbridge_via_cn700_config { 
    2322}; 
    2423 
  • trunk/coreboot-v2/src/northbridge/via/cn700/cn700.h

    r3113 r3644  
    2020 
    2121#ifndef __ROMCC__ 
    22 static void cn700_noop(){} 
     22static void cn700_noop() 
     23{ 
     24} 
    2325#endif 
    2426 
    2527/* VGA stuff */ 
    26 #define SR_INDEX        0x3c4 
    27 #define SR_DATA         0x3c5 
    28 #define CRTM_INDEX      0x3b4 
    29 #define CRTM_DATA       0x3b5 
    30 #define CRTC_INDEX      0x3d4 
    31 #define CRTC_DATA       0x3d5 
     28#define SR_INDEX                0x3c4 
     29#define SR_DATA                 0x3c5 
     30#define CRTM_INDEX              0x3b4 
     31#define CRTM_DATA               0x3b5 
     32#define CRTC_INDEX              0x3d4 
     33#define CRTC_DATA               0x3d5 
    3234 
    33 /* Memory Controller Registers */ 
     35/* Memory controller registers */ 
    3436#define RANK0_END               0x40 
    3537#define RANK1_END               0x41 
     
    4648#define CH_A_MD_OUTPUT_DELAY    0x71 
    4749 
    48 /* RAM Init Commands */ 
     50/* RAM init commands */ 
    4951#define RAM_COMMAND_NORMAL      0x0 
    5052#define RAM_COMMAND_NOP         0x1 
  • trunk/coreboot-v2/src/northbridge/via/cn700/northbridge.c

    r3334 r3644  
    3939        device_t vlink_dev; 
    4040        u16 reg16; 
    41         u8 ranks; 
    42         u8 pagec, paged, pagee, pagef; 
    43         u8 shadowreg; 
    44          
    45         /* Set up the vga framebuffer size */ 
     41        u8 ranks, pagec, paged, pagee, pagef, shadowreg; 
     42 
     43        /* Set up the VGA framebuffer size. */ 
    4644        reg16 = (log2(CONFIG_VIDEO_MB) << 12) | (1 << 15); 
    4745        pci_write_config16(dev, 0xa0, reg16); 
    48          
    49         /* Set up VGA timers */ 
     46 
     47        /* Set up VGA timers. */ 
    5048        pci_write_config8(dev, 0xa2, 0x44); 
    51          
     49 
    5250        for (ranks = 0x4b; ranks >= 0x48; ranks--) { 
    5351                if (pci_read_config8(dev, ranks)) { 
     
    6563        pci_write_config8(dev, 0xb8, 0x08); 
    6664 
    67         /* shadown ram */ 
     65        /* Shadow RAM */ 
    6866        pagec = 0xff, paged = 0xff, pagee = 0xff, pagef = 0x30; 
    6967        /* PAGE C, D, E are all read write enable */ 
     
    7674        pci_write_config8(dev, 0x83, shadowreg); 
    7775        /* vlink mirror */ 
    78         vlink_dev = dev_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_CN700_VLINK, 0); 
     76        vlink_dev = dev_find_device(PCI_VENDOR_ID_VIA, 
     77                                    PCI_DEVICE_ID_VIA_CN700_VLINK, 0); 
    7978        if (vlink_dev) { 
    8079                pci_write_config8(vlink_dev, 0x61, pagec); 
    8180                pci_write_config8(vlink_dev, 0x62, paged); 
    8281                pci_write_config8(vlink_dev, 0x64, pagee); 
     82 
    8383                shadowreg = pci_read_config8(vlink_dev, 0x63); 
    8484                shadowreg |= pagef; 
     
    8989static const struct device_operations memctrl_operations = { 
    9090        .read_resources = cn700_noop, 
    91         .init = memctrl_init, 
     91        .init           = memctrl_init, 
    9292}; 
    9393 
    9494static const struct pci_driver memctrl_driver __pci_driver = { 
    95         .ops = &memctrl_operations, 
     95        .ops    = &memctrl_operations, 
    9696        .vendor = PCI_VENDOR_ID_VIA, 
    9797        .device = PCI_DEVICE_ID_VIA_CN700_MEMCTRL, 
     
    100100static void pci_domain_read_resources(device_t dev) 
    101101{ 
    102         struct resource *resource; 
     102        struct resource *resource; 
    103103 
    104104        printk_spew("Entering cn700 pci_domain_read_resources.\n"); 
    105105 
    106         /* Initialize the system wide io space constraints */ 
    107         resource = new_resource(dev, IOINDEX_SUBTRACTIVE(0,0)); 
    108         resource->limit = 0xffffUL; 
    109         resource->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | 
    110                 IORESOURCE_ASSIGNED; 
    111  
    112         /* Initialize the system wide memory resources constraints */ 
    113         resource = new_resource(dev, IOINDEX_SUBTRACTIVE(1,0)); 
    114         resource->limit = 0xffffffffULL; 
    115         resource->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | 
    116                 IORESOURCE_ASSIGNED; 
     106        /* Initialize the system wide I/O space constraints. */ 
     107        resource = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0)); 
     108        resource->limit = 0xffffUL; 
     109        resource->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | 
     110            IORESOURCE_ASSIGNED; 
     111 
     112        /* Initialize the system wide memory resources constraints. */ 
     113        resource = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0)); 
     114        resource->limit = 0xffffffffULL; 
     115        resource->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | 
     116            IORESOURCE_ASSIGNED; 
    117117 
    118118        printk_spew("Leaving cn700 pci_domain_read_resources.\n"); 
     
    120120 
    121121static void ram_resource(device_t dev, unsigned long index, 
    122         unsigned long basek, unsigned long sizek) 
    123 { 
    124         struct resource *resource; 
    125  
    126         if (!sizek) { 
    127                 return; 
    128         } 
    129         resource = new_resource(dev, index); 
    130         resource->base  = ((resource_t)basek) << 10; 
    131         resource->size  = ((resource_t)sizek) << 10; 
    132         resource->flags =  IORESOURCE_MEM | IORESOURCE_CACHEABLE | \ 
    133                 IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; 
     122                        unsigned long basek, unsigned long sizek) 
     123{ 
     124        struct resource *resource; 
     125 
     126        if (!sizek) 
     127                return; 
     128 
     129        resource = new_resource(dev, index); 
     130        resource->base = ((resource_t) basek) << 10; 
     131        resource->size = ((resource_t) sizek) << 10; 
     132        resource->flags = IORESOURCE_MEM | IORESOURCE_CACHEABLE | 
     133            IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; 
    134134} 
    135135 
     
    138138        struct resource **best_p = gp; 
    139139        struct resource *best; 
     140 
    140141        best = *best_p; 
    141         if (!best || (best->base > new->base)) { 
     142        if (!best || (best->base > new->base)) 
    142143                best = new; 
    143         } 
    144144        *best_p = best; 
    145145} 
     
    147147static u32 find_pci_tolm(struct bus *bus) 
    148148{ 
    149         print_debug("Entering find_pci_tolm\n"); 
    150149        struct resource *min; 
    151150        u32 tolm; 
     151 
     152        print_debug("Entering find_pci_tolm\n"); 
     153 
    152154        min = 0; 
    153         search_bus_resources(bus, IORESOURCE_MEM, IORESOURCE_MEM, tolm_test, &min); 
     155        search_bus_resources(bus, IORESOURCE_MEM, IORESOURCE_MEM, 
     156                             tolm_test, &min); 
    154157        tolm = 0xffffffffUL; 
    155         if (min && tolm > min->base) { 
     158        if (min && tolm > min->base) 
    156159                tolm = min->base; 
    157         } 
     160 
    158161        print_debug("Leaving find_pci_tolm\n"); 
     162 
    159163        return tolm; 
    160164} 
     
    162166static void pci_domain_set_resources(device_t dev) 
    163167{ 
    164         /*  
    165          * the order is important to find the correct ram size. 
    166          */ 
    167         static const u8 ramregs[] = {0x43, 0x42, 0x41, 0x40}; 
     168        /* The order is important to find the correct RAM size. */ 
     169        static const u8 ramregs[] = { 0x43, 0x42, 0x41, 0x40 }; 
    168170        device_t mc_dev; 
    169         u32 pci_tolm; 
     171        u32 pci_tolm; 
    170172 
    171173        printk_spew("Entering cn700 pci_domain_set_resources.\n"); 
    172174 
    173         pci_tolm = find_pci_tolm(&dev->link[0]); 
    174         mc_dev = dev_find_device(PCI_VENDOR_ID_VIA,  
    175                                 PCI_DEVICE_ID_VIA_CN700_MEMCTRL, 0); 
     175        pci_tolm = find_pci_tolm(&dev->link[0]); 
     176        mc_dev = dev_find_device(PCI_VENDOR_ID_VIA, 
     177                                 PCI_DEVICE_ID_VIA_CN700_MEMCTRL, 0); 
    176178 
    177179        if (mc_dev) { 
     
    181183 
    182184                /* 
    183                  * once the register value is not zero, the ramsize is 
    184                  * this register's value multiply 64 * 1024 * 1024 
     185                 * Once the register value is not zero, the RAM size is 
     186                 * this register's value multiply 64 * 1024 * 1024. 
    185187                 */ 
    186                 for(rambits = 0, i = 0; i < ARRAY_SIZE(ramregs); i++) { 
    187                         unsigned char reg; 
     188                for (rambits = 0, i = 0; i < ARRAY_SIZE(ramregs); i++) { 
    188189                        rambits = pci_read_config8(mc_dev, ramregs[i]); 
    189190                        if (rambits != 0) 
    190191                                break; 
    191192                } 
    192                  
     193 
    193194                tomk = rambits * 64 * 1024; 
    194195                printk_spew("tomk is 0x%x\n", tomk); 
    195                 /* Compute the Top Of Low Memory, in Kb */ 
     196                /* Compute the Top Of Low Memory (TOLM), in Kb. */ 
    196197                tolmk = pci_tolm >> 10; 
    197198                if (tolmk >= tomk) { 
     
    199200                        tolmk = tomk; 
    200201                } 
    201                 /* Report the memory regions */ 
     202                /* Report the memory regions. */ 
    202203                idx = 10; 
    203204                /* TODO: Hole needed? */ 
    204                 ram_resource(dev, idx++, 0, 640); /* first 640k */ 
    205                 /* Leave a hole for vga, 0xa0000 - 0xc0000 */ 
    206                 ram_resource(dev, idx++, 768, (tolmk - 768 - CONFIG_VIDEO_MB * 1024)); 
     205                ram_resource(dev, idx++, 0, 640);       /* First 640k */ 
     206                /* Leave a hole for VGA, 0xa0000 - 0xc0000 */ 
     207                ram_resource(dev, idx++, 768, 
     208                             (tolmk - 768 - CONFIG_VIDEO_MB * 1024)); 
    207209        } 
    208210        assign_resources(&dev->link[0]); 
     
    213215        printk_debug("Entering cn700 pci_domain_scan_bus.\n"); 
    214216 
    215         max = pci_scan_bus(&dev->link[0], PCI_DEVFN(0, 0), 0xff, max); 
    216         return max; 
     217        max = pci_scan_bus(&dev->link[0], PCI_DEVFN(0, 0), 0xff, max); 
     218        return max; 
    217219} 
    218220 
    219221static const struct device_operations pci_domain_ops = { 
    220         .read_resources   = pci_domain_read_resources, 
    221         .set_resources    = pci_domain_set_resources, 
    222         .enable_resources = enable_childrens_resources, 
    223         .init             = 0, 
    224         .scan_bus         = pci_domain_scan_bus, 
    225 };   
     222        .read_resources   = pci_domain_read_resources, 
     223        .set_resources    = pci_domain_set_resources, 
     224        .enable_resources = enable_childrens_resources, 
     225        .init             = 0, 
     226        .scan_bus         = pci_domain_scan_bus, 
     227}; 
    226228 
    227229static void cpu_bus_init(device_t dev) 
    228230{ 
    229         initialize_cpus(&dev->link[0]); 
     231        initialize_cpus(&dev->link[0]); 
    230232} 
    231233 
     
    235237 
    236238static const struct device_operations cpu_bus_ops = { 
    237         .read_resources   = cpu_bus_noop, 
    238         .set_resources    = cpu_bus_noop, 
    239         .enable_resources = cpu_bus_noop, 
    240         .init             = cpu_bus_init, 
    241         .scan_bus         = 0, 
     239        .read_resources   = cpu_bus_noop, 
     240        .set_resources    = cpu_bus_noop, 
     241        .enable_resources = cpu_bus_noop, 
     242        .init             = cpu_bus_init, 
     243        .scan_bus         = 0, 
    242244}; 
    243245 
     
    246248        printk_spew("In cn700 enable_dev for device %s.\n", dev_path(dev)); 
    247249 
    248         /* Set the operations if it is a special bus type */ 
    249         if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) { 
    250                 dev->ops = &pci_domain_ops; 
     250        /* Set the operations if it is a special bus type. */ 
     251        if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) { 
     252                dev->ops = &pci_domain_ops; 
    251253                pci_set_method(dev); 
    252         } 
    253         else if (dev->path.type == DEVICE_PATH_APIC_CLUSTER) { 
    254                 dev->ops = &cpu_bus_ops; 
    255         } 
     254        } else if (dev->path.type == DEVICE_PATH_APIC_CLUSTER) { 
     255                dev->ops = &cpu_bus_ops; 
     256        } 
    256257} 
    257258 
  • trunk/coreboot-v2/src/northbridge/via/cn700/raminit.c

    r3556 r3644  
    2626#include "cn700.h" 
    2727 
    28 //#define DEBUG_RAM_SETUP 1 
     28// #define DEBUG_RAM_SETUP 1 
    2929 
    3030#ifdef DEBUG_RAM_SETUP 
     
    6161 
    6262/** 
    63  * Configure the bus between the cpu and the northbridge. This might be able to  
     63 * Configure the bus between the CPU and the northbridge. This might be able to  
    6464 * be moved to post-ram code in the future. For the most part, these registers 
    6565 * should not be messed around with. These are too complex to explain short of 
     
    6868 * try the values from your factory BIOS. 
    6969 * 
    70  * TODO: Changing the DRAM frequency doesn't work (hard lockup) 
    71  * 
    72  * @param dev The northbridge's CPU Host Interface (D0F2) 
     70 * TODO: Changing the DRAM frequency doesn't work (hard lockup). 
     71 * 
     72 * @param dev The northbridge's CPU Host Interface (D0F2). 
    7373 */ 
    7474static void c7_cpu_setup(device_t dev) 
     
    8888        pci_write_config8(dev, 0x56, 0x01); 
    8989        /* Miscellaneous Control */ 
    90         /* DRAM Operating Frequency (Bits 7:5) 
    91          *      000 : 100MHz    001 : 133MHz 
    92          *      010 : 166MHz    011 : 200MHz 
    93          *      100 : 266MHz    101 : 333MHz 
    94          *      110/111 : Reserved */ 
     90        /* 
     91         * DRAM Operating Frequency (bits 7:5) 
     92         *      000 : 100MHz    001 : 133MHz 
     93         *      010 : 166MHz    011 : 200MHz 
     94         *      100 : 266MHz    101 : 333MHz 
     95         *      110/111 : Reserved 
     96         */ 
    9597        /* CPU Miscellaneous Control */ 
    96         pci_write_config8(dev, 0x59, 0x44);      
     98        pci_write_config8(dev, 0x59, 0x44); 
    9799        /* Write Policy */ 
    98100        pci_write_config8(dev, 0x5d, 0xb2); 
     
    113115        pci_write_config8(dev, 0x66, 0xff); 
    114116        pci_write_config8(dev, 0x67, 0x30); 
    115                  
    116         /* Host Bus IO Circuit (See datasheet) */ 
     117 
     118        /* Host Bus I/O Circuit (see datasheet) */ 
    117119        /* Host Address Pullup/down Driving */ 
    118120        pci_write_config8(dev, 0x70, 0x11); 
     
    134136        /* Address Strobe Input Delay Control */ 
    135137        pci_write_config8(dev, 0x7a, 0x24); 
    136         // Address CKG Rising/Falling Time Control 
     138        /* Address CKG Rising/Falling Time Control */ 
    137139        pci_write_config8(dev, 0x7b, 0xaa); 
    138140        /* Address CKG Clock Rising/Falling Time Control */ 
     
    149151 
    150152/** 
    151  * Set up dram size according to spd data. Eventually, DRAM timings should be  
     153 * Set up DRAM size according to SPD data. Eventually, DRAM timings should be 
    152154 * done in a similar manner. 
    153155 * 
    154  * @param ctrl The northbridge devices and spd addresses. 
     156 * @param ctrl The northbridge devices and SPD addresses. 
    155157 */ 
    156158static void sdram_set_size(const struct mem_controller *ctrl) 
     
    160162        ranks = spd_read_byte(ctrl->channel0[0], SPD_NUM_DIMM_BANKS); 
    161163        ranks = (ranks & 0x07) + 1; 
    162         density = spd_read_byte(ctrl->channel0[0], SPD_DENSITY_OF_EACH_ROW_ON_MODULE); 
    163         switch (density) 
    164         { 
    165                 case 0x80: 
    166                         result = 0x08;  /* 512MB / 64MB = 0x08 */ 
    167                         break; 
    168                 case 0x40: 
    169                         result = 0x04; 
    170                         break; 
    171                 case 0x20: 
    172                         result = 0x02; 
    173                         break; 
    174                 case 0x10: 
    175                         result = 0xff;  /* 16GB */ 
    176                         break; 
    177                 case 0x08: 
    178                         result = 0xff;  /* 8GB */ 
    179                         break; 
    180                 case 0x04: 
    181                         result = 0xff;  /* 4GB */ 
    182                         break; 
    183                 case 0x02: 
    184                         result = 0x20;  /* 2GB */ 
    185                         break; 
    186                 case 0x01: 
    187