wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Rob Taylor, Flying Pig Systems. robt@flyingpig.com. |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <mpc824x.h> |
| 10 | #include <pci.h> |
Ben Warren | 840f8a5 | 2008-08-31 10:45:44 -0700 | [diff] [blame] | 11 | #include <netdev.h> |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 12 | |
| 13 | int checkboard (void) |
| 14 | { |
| 15 | ulong busfreq = get_bus_freq(0); |
| 16 | char buf[32]; |
| 17 | |
| 18 | printf("Board: MUSENKI Local Bus at %s MHz\n", strmhz(buf, busfreq)); |
| 19 | return 0; |
| 20 | |
| 21 | } |
| 22 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 23 | #if 0 /* NOT USED */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 24 | int checkflash (void) |
| 25 | { |
| 26 | /* TODO: XXX XXX XXX */ |
| 27 | printf ("## Test not implemented yet ##\n"); |
| 28 | |
| 29 | return (0); |
| 30 | } |
| 31 | #endif |
| 32 | |
Becky Bruce | bd99ae7 | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 33 | phys_size_t initdram (int board_type) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 34 | { |
wdenk | 87249ba | 2004-01-06 22:38:14 +0000 | [diff] [blame] | 35 | long size; |
| 36 | long new_bank0_end; |
| 37 | long mear1; |
| 38 | long emear1; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 39 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 40 | size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MAX_RAM_SIZE); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 41 | |
wdenk | 87249ba | 2004-01-06 22:38:14 +0000 | [diff] [blame] | 42 | new_bank0_end = size - 1; |
| 43 | mear1 = mpc824x_mpc107_getreg(MEAR1); |
| 44 | emear1 = mpc824x_mpc107_getreg(EMEAR1); |
| 45 | mear1 = (mear1 & 0xFFFFFF00) | |
| 46 | ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT); |
| 47 | emear1 = (emear1 & 0xFFFFFF00) | |
| 48 | ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT); |
| 49 | mpc824x_mpc107_setreg(MEAR1, mear1); |
| 50 | mpc824x_mpc107_setreg(EMEAR1, emear1); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 51 | |
wdenk | 87249ba | 2004-01-06 22:38:14 +0000 | [diff] [blame] | 52 | return (size); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | /* |
| 56 | * Initialize PCI Devices |
| 57 | */ |
| 58 | #ifndef CONFIG_PCI_PNP |
| 59 | static struct pci_config_table pci_sandpoint_config_table[] = { |
| 60 | #if 0 |
| 61 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| 62 | 0x0, 0x0, 0x0, /* unknown eth0 divice */ |
| 63 | pci_cfgfunc_config_device, { PCI_ENET0_IOADDR, |
| 64 | PCI_ENET0_MEMADDR, |
| 65 | PCI_COMMAND_IO | |
| 66 | PCI_COMMAND_MEMORY | |
| 67 | PCI_COMMAND_MASTER }}, |
| 68 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| 69 | 0x0, 0x0, 0x0, /* unknown eth1 device */ |
| 70 | pci_cfgfunc_config_device, { PCI_ENET1_IOADDR, |
| 71 | PCI_ENET1_MEMADDR, |
| 72 | PCI_COMMAND_IO | |
| 73 | PCI_COMMAND_MEMORY | |
| 74 | PCI_COMMAND_MASTER }}, |
| 75 | #endif |
| 76 | { } |
| 77 | }; |
| 78 | #endif |
| 79 | |
| 80 | struct pci_controller hose = { |
| 81 | #ifndef CONFIG_PCI_PNP |
| 82 | config_table: pci_sandpoint_config_table, |
| 83 | #endif |
| 84 | }; |
| 85 | |
stroese | f5dd410 | 2003-02-14 11:21:23 +0000 | [diff] [blame] | 86 | void pci_init_board(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 87 | { |
| 88 | pci_mpc824x_init(&hose); |
| 89 | } |
Ben Warren | 840f8a5 | 2008-08-31 10:45:44 -0700 | [diff] [blame] | 90 | |
| 91 | int board_eth_init(bd_t *bis) |
| 92 | { |
| 93 | return pci_eth_init(bis); |
| 94 | } |