diff options
Diffstat (limited to 'src/mainboard/tyan')
-rw-r--r-- | src/mainboard/tyan/s2735/mainboard.c | 26 | ||||
-rw-r--r-- | src/mainboard/tyan/s2850/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s2880/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s2881/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s2882/auto.c | 5 | ||||
-rw-r--r-- | src/mainboard/tyan/s2882/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s2885/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s4880/auto.c | 2 | ||||
-rw-r--r-- | src/mainboard/tyan/s4880/mainboard.c | 107 | ||||
-rw-r--r-- | src/mainboard/tyan/s4882/mainboard.c | 108 |
10 files changed, 11 insertions, 772 deletions
diff --git a/src/mainboard/tyan/s2735/mainboard.c b/src/mainboard/tyan/s2735/mainboard.c index 7898d2e7e4..29cf899be8 100644 --- a/src/mainboard/tyan/s2735/mainboard.c +++ b/src/mainboard/tyan/s2735/mainboard.c @@ -119,30 +119,6 @@ static void vga_fixup(void) { } */ -static int -mainboard_scan_bus(device_t root, int maxbus) -{ - int retval; - printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus); - retval = pci_scan_bus(root->bus, 0, 0xff, maxbus); - printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus); - return maxbus; -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = root_dev_init, - .scan_bus = mainboard_scan_bus, -}; - -static void enable_dev(device_t dev) -{ - dev->ops = &mainboard_operations; -} - struct chip_operations mainboard_tyan_s2735_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s2735 mainboard") }; - diff --git a/src/mainboard/tyan/s2850/mainboard.c b/src/mainboard/tyan/s2850/mainboard.c index ce2405e3cd..1270b59146 100644 --- a/src/mainboard/tyan/s2850/mainboard.c +++ b/src/mainboard/tyan/s2850/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s2850_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s2850 mainboard") }; diff --git a/src/mainboard/tyan/s2880/mainboard.c b/src/mainboard/tyan/s2880/mainboard.c index a0014f3fae..dd27224fbe 100644 --- a/src/mainboard/tyan/s2880/mainboard.c +++ b/src/mainboard/tyan/s2880/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s2880_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tayn s2880 mainboard") }; diff --git a/src/mainboard/tyan/s2881/mainboard.c b/src/mainboard/tyan/s2881/mainboard.c index e058fe6a6d..b88a992e84 100644 --- a/src/mainboard/tyan/s2881/mainboard.c +++ b/src/mainboard/tyan/s2881/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s2881_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s2881 mainboard") }; diff --git a/src/mainboard/tyan/s2882/auto.c b/src/mainboard/tyan/s2882/auto.c index b076acdd1a..73aeda4107 100644 --- a/src/mainboard/tyan/s2882/auto.c +++ b/src/mainboard/tyan/s2882/auto.c @@ -126,11 +126,10 @@ static inline int spd_read_byte(unsigned device, unsigned address) return smbus_read_byte(device, address); } -//#include "northbridge/amd/amdk8/setup_resource_map.c" -#include "northbridge/amd/amdk8/resourcemap.c" #include "northbridge/amd/amdk8/raminit.c" #include "northbridge/amd/amdk8/coherent_ht.c" #include "sdram/generic_sdram.c" +#include "northbridge/amd/amdk8/resourcemap.c" #define FIRST_CPU 1 @@ -196,7 +195,7 @@ static void main(unsigned long bist) console_init(); /* Halt if there was a built in self test failure */ -// report_bist_failure(bist); + report_bist_failure(bist); setup_default_resource_map(); needs_reset = setup_coherent_ht_domain(); diff --git a/src/mainboard/tyan/s2882/mainboard.c b/src/mainboard/tyan/s2882/mainboard.c index 8bc1ac9b9a..9bee33d598 100644 --- a/src/mainboard/tyan/s2882/mainboard.c +++ b/src/mainboard/tyan/s2882/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s2882_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s2882 mainboard") }; diff --git a/src/mainboard/tyan/s2885/mainboard.c b/src/mainboard/tyan/s2885/mainboard.c index a51278b06a..080a9dc03d 100644 --- a/src/mainboard/tyan/s2885/mainboard.c +++ b/src/mainboard/tyan/s2885/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s2885_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s2885 mainboard") }; diff --git a/src/mainboard/tyan/s4880/auto.c b/src/mainboard/tyan/s4880/auto.c index a19b4fa4bc..b083ce0c91 100644 --- a/src/mainboard/tyan/s4880/auto.c +++ b/src/mainboard/tyan/s4880/auto.c @@ -256,7 +256,7 @@ static void main(unsigned long bist) console_init(); /* Halt if there was a built in self test failure */ -// report_bist_failure(bist); + report_bist_failure(bist); setup_s4880_resource_map(); needs_reset = setup_coherent_ht_domain(); diff --git a/src/mainboard/tyan/s4880/mainboard.c b/src/mainboard/tyan/s4880/mainboard.c index 1c3e40c13a..cec60e7af3 100644 --- a/src/mainboard/tyan/s4880/mainboard.c +++ b/src/mainboard/tyan/s4880/mainboard.c @@ -163,111 +163,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s4880_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s4880 mainboard") }; diff --git a/src/mainboard/tyan/s4882/mainboard.c b/src/mainboard/tyan/s4882/mainboard.c index 59723ac4e3..39696b8741 100644 --- a/src/mainboard/tyan/s4882/mainboard.c +++ b/src/mainboard/tyan/s4882/mainboard.c @@ -162,112 +162,6 @@ enable(struct chip *chip, enum chip_pass pass) } #endif - -#undef DEBUG -#define DEBUG 0 -#if DEBUG -static void debug_init(device_t dev) -{ - unsigned bus; - unsigned devfn; -#if 0 - for(bus = 0; bus < 256; bus++) { - for(devfn = 0; devfn < 256; devfn++) { - int i; - dev = dev_find_slot(bus, devfn); - if (!dev) { - continue; - } - if (!dev->enabled) { - continue; - } - printk_info("%02x:%02x.%0x aka %s\n", - bus, devfn >> 3, devfn & 7, dev_path(dev)); - for(i = 0; i < 256; i++) { - if ((i & 0x0f) == 0) { - printk_info("%02x:", i); - } - printk_info(" %02x", pci_read_config8(dev, i)); - if ((i & 0x0f) == 0xf) { - printk_info("\n"); - } - } - printk_info("\n"); - } - } -#endif -#if 0 - msr_t msr; - unsigned index; - unsigned eax, ebx, ecx, edx; - index = 0x80000007; - printk_debug("calling cpuid 0x%08x\n", index); - asm volatile( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (index) - ); - printk_debug("cpuid[%08x]: %08x %08x %08x %08x\n", - index, eax, ebx, ecx, edx); - if (edx & (3 << 1)) { - index = 0xC0010042; - printk_debug("Reading msr: 0x%08x\n", index); - msr = rdmsr(index); - printk_debug("msr[0x%08x]: 0x%08x%08x\n", - index, msr.hi, msr.hi); - } -#endif -} - -static void debug_noop(device_t dummy) -{ -} - -static struct device_operations debug_operations = { - .read_resources = debug_noop, - .set_resources = debug_noop, - .enable_resources = debug_noop, - .init = debug_init, -}; - -static unsigned int scan_root_bus(device_t root, unsigned int max) -{ - struct device_path path; - device_t debug; - max = root_dev_scan_bus(root, max); - path.type = DEVICE_PATH_PNP; - path.u.pnp.port = 0; - path.u.pnp.device = 0; - debug = alloc_dev(&root->link[1], &path); - debug->ops = &debug_operations; - return max; -} -#endif - -static void mainboard_init(device_t dev) -{ - root_dev_init(dev); - -// do_verify_cpu_voltages(); -} - -static struct device_operations mainboard_operations = { - .read_resources = root_dev_read_resources, - .set_resources = root_dev_set_resources, - .enable_resources = root_dev_enable_resources, - .init = mainboard_init, -#if !DEBUG - .scan_bus = root_dev_scan_bus, -#else - .scan_bus = scan_root_bus, -#endif - .enable = 0, -}; - -static void enable_dev(struct device *dev) -{ - dev_root.ops = &mainboard_operations; -} struct chip_operations mainboard_tyan_s4882_ops = { - .enable_dev = enable_dev, + CHIP_NAME("Tyan s4882 mainboard") }; |