yosemite.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /*
  2. * (C) Copyright 2006-2007
  3. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <ppc4xx.h>
  25. #include <asm/processor.h>
  26. #include <asm/io.h>
  27. #include <spd_sdram.h>
  28. #include <libfdt.h>
  29. #include <fdt_support.h>
  30. DECLARE_GLOBAL_DATA_PTR;
  31. extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
  32. static inline u32 get_async_pci_freq(void)
  33. {
  34. if (in_8((void *)(CONFIG_SYS_BCSR_BASE + 5)) &
  35. CONFIG_SYS_BCSR5_PCI66EN)
  36. return 66666666;
  37. else
  38. return 33333333;
  39. }
  40. int board_early_init_f(void)
  41. {
  42. register uint reg;
  43. /*--------------------------------------------------------------------
  44. * Setup the external bus controller/chip selects
  45. *-------------------------------------------------------------------*/
  46. mtdcr(EBC0_CFGADDR, EBC0_CFG);
  47. reg = mfdcr(EBC0_CFGDATA);
  48. mtdcr(EBC0_CFGDATA, reg | 0x04000000); /* Set ATC */
  49. /*--------------------------------------------------------------------
  50. * Setup the GPIO pins
  51. *-------------------------------------------------------------------*/
  52. /*CPLD cs */
  53. /*setup Address lines for flash size 64Meg. */
  54. out32(GPIO0_OSRL, in32(GPIO0_OSRL) | 0x50010000);
  55. out32(GPIO0_TSRL, in32(GPIO0_TSRL) | 0x50010000);
  56. out32(GPIO0_ISR1L, in32(GPIO0_ISR1L) | 0x50000000);
  57. /*setup emac */
  58. out32(GPIO0_TCR, in32(GPIO0_TCR) | 0xC080);
  59. out32(GPIO0_TSRL, in32(GPIO0_TSRL) | 0x40);
  60. out32(GPIO0_ISR1L, in32(GPIO0_ISR1L) | 0x55);
  61. out32(GPIO0_OSRH, in32(GPIO0_OSRH) | 0x50004000);
  62. out32(GPIO0_ISR1H, in32(GPIO0_ISR1H) | 0x00440000);
  63. /*UART1 */
  64. out32(GPIO1_TCR, in32(GPIO1_TCR) | 0x02000000);
  65. out32(GPIO1_OSRL, in32(GPIO1_OSRL) | 0x00080000);
  66. out32(GPIO1_ISR2L, in32(GPIO1_ISR2L) | 0x00010000);
  67. /* external interrupts IRQ0...3 */
  68. out32(GPIO1_TCR, in32(GPIO1_TCR) & ~0x00f00000);
  69. out32(GPIO1_TSRL, in32(GPIO1_TSRL) & ~0x0000ff00);
  70. out32(GPIO1_ISR1L, in32(GPIO1_ISR1L) | 0x00005500);
  71. #ifdef CONFIG_440EP
  72. /*setup USB 2.0 */
  73. out32(GPIO1_TCR, in32(GPIO1_TCR) | 0xc0000000);
  74. out32(GPIO1_OSRL, in32(GPIO1_OSRL) | 0x50000000);
  75. out32(GPIO0_TCR, in32(GPIO0_TCR) | 0xf);
  76. out32(GPIO0_OSRH, in32(GPIO0_OSRH) | 0xaa);
  77. out32(GPIO0_ISR2H, in32(GPIO0_ISR2H) | 0x00000500);
  78. #endif
  79. /*--------------------------------------------------------------------
  80. * Setup the interrupt controller polarities, triggers, etc.
  81. *-------------------------------------------------------------------*/
  82. mtdcr(UIC0SR, 0xffffffff); /* clear all */
  83. mtdcr(UIC0ER, 0x00000000); /* disable all */
  84. mtdcr(UIC0CR, 0x00000009); /* ATI & UIC1 crit are critical */
  85. mtdcr(UIC0PR, 0xfffffe13); /* per ref-board manual */
  86. mtdcr(UIC0TR, 0x01c00008); /* per ref-board manual */
  87. mtdcr(UIC0VR, 0x00000001); /* int31 highest, base=0x000 */
  88. mtdcr(UIC0SR, 0xffffffff); /* clear all */
  89. mtdcr(UIC1SR, 0xffffffff); /* clear all */
  90. mtdcr(UIC1ER, 0x00000000); /* disable all */
  91. mtdcr(UIC1CR, 0x00000000); /* all non-critical */
  92. mtdcr(UIC1PR, 0xffffe0ff); /* per ref-board manual */
  93. mtdcr(UIC1TR, 0x00ffc000); /* per ref-board manual */
  94. mtdcr(UIC1VR, 0x00000001); /* int31 highest, base=0x000 */
  95. mtdcr(UIC1SR, 0xffffffff); /* clear all */
  96. /*--------------------------------------------------------------------
  97. * Setup other serial configuration
  98. *-------------------------------------------------------------------*/
  99. mfsdr(SDR0_PCI0, reg);
  100. mtsdr(SDR0_PCI0, 0x80000000 | reg); /* PCI arbiter enabled */
  101. mtsdr(SDR0_PFC0, 0x00003e00); /* Pin function */
  102. mtsdr(SDR0_PFC1, 0x00048000); /* Pin function: UART0 has 4 pins */
  103. /* Check and reconfigure the PCI sync clock if necessary */
  104. ppc4xx_pci_sync_clock_config(get_async_pci_freq());
  105. /*clear tmrclk divisor */
  106. *(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x04) = 0x00;
  107. /*enable ethernet */
  108. *(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x08) = 0xf0;
  109. #ifdef CONFIG_440EP
  110. /*enable usb 1.1 fs device and remove usb 2.0 reset */
  111. *(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x09) = 0x00;
  112. #endif
  113. /*get rid of flash write protect */
  114. *(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x07) = 0x00;
  115. return 0;
  116. }
  117. int misc_init_r (void)
  118. {
  119. uint pbcr;
  120. int size_val = 0;
  121. /* Re-do sizing to get full correct info */
  122. mtdcr(EBC0_CFGADDR, PB0CR);
  123. pbcr = mfdcr(EBC0_CFGDATA);
  124. switch (gd->bd->bi_flashsize) {
  125. case 1 << 20:
  126. size_val = 0;
  127. break;
  128. case 2 << 20:
  129. size_val = 1;
  130. break;
  131. case 4 << 20:
  132. size_val = 2;
  133. break;
  134. case 8 << 20:
  135. size_val = 3;
  136. break;
  137. case 16 << 20:
  138. size_val = 4;
  139. break;
  140. case 32 << 20:
  141. size_val = 5;
  142. break;
  143. case 64 << 20:
  144. size_val = 6;
  145. break;
  146. case 128 << 20:
  147. size_val = 7;
  148. break;
  149. }
  150. pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
  151. mtdcr(EBC0_CFGADDR, PB0CR);
  152. mtdcr(EBC0_CFGDATA, pbcr);
  153. /* adjust flash start and offset */
  154. gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
  155. gd->bd->bi_flashoffset = 0;
  156. /* Monitor protection ON by default */
  157. (void)flash_protect(FLAG_PROTECT_SET,
  158. -CONFIG_SYS_MONITOR_LEN,
  159. 0xffffffff,
  160. &flash_info[0]);
  161. return 0;
  162. }
  163. int checkboard(void)
  164. {
  165. char *s = getenv("serial#");
  166. u8 rev;
  167. u32 clock = get_async_pci_freq();
  168. #ifdef CONFIG_440EP
  169. printf("Board: Yosemite - AMCC PPC440EP Evaluation Board");
  170. #else
  171. printf("Board: Yellowstone - AMCC PPC440GR Evaluation Board");
  172. #endif
  173. rev = in_8((void *)(CONFIG_SYS_BCSR_BASE + 0));
  174. printf(", Rev. %X, PCI-Async=%d MHz", rev, clock / 1000000);
  175. if (s != NULL) {
  176. puts(", serial# ");
  177. puts(s);
  178. }
  179. putc('\n');
  180. /*
  181. * Reconfiguration of the PCI sync clock is already done,
  182. * now check again if everything is in range:
  183. */
  184. if (ppc4xx_pci_sync_clock_config(clock)) {
  185. printf("ERROR: PCI clocking incorrect (async=%d "
  186. "sync=%ld)!\n", clock, get_PCI_freq());
  187. }
  188. return (0);
  189. }
  190. /*************************************************************************
  191. * initdram -- doesn't use serial presence detect.
  192. *
  193. * Assumes: 256 MB, ECC, non-registered
  194. * PLB @ 133 MHz
  195. *
  196. ************************************************************************/
  197. #define NUM_TRIES 64
  198. #define NUM_READS 10
  199. void sdram_tr1_set(int ram_address, int* tr1_value)
  200. {
  201. int i;
  202. int j, k;
  203. volatile unsigned int* ram_pointer = (unsigned int*)ram_address;
  204. int first_good = -1, last_bad = 0x1ff;
  205. unsigned long test[NUM_TRIES] = {
  206. 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
  207. 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
  208. 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
  209. 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
  210. 0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
  211. 0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
  212. 0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
  213. 0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
  214. 0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
  215. 0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
  216. 0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
  217. 0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
  218. 0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
  219. 0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
  220. 0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55,
  221. 0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55 };
  222. /* go through all possible SDRAM0_TR1[RDCT] values */
  223. for (i=0; i<=0x1ff; i++) {
  224. /* set the current value for TR1 */
  225. mtsdram(SDRAM0_TR1, (0x80800800 | i));
  226. /* write values */
  227. for (j=0; j<NUM_TRIES; j++) {
  228. ram_pointer[j] = test[j];
  229. /* clear any cache at ram location */
  230. __asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
  231. }
  232. /* read values back */
  233. for (j=0; j<NUM_TRIES; j++) {
  234. for (k=0; k<NUM_READS; k++) {
  235. /* clear any cache at ram location */
  236. __asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
  237. if (ram_pointer[j] != test[j])
  238. break;
  239. }
  240. /* read error */
  241. if (k != NUM_READS) {
  242. break;
  243. }
  244. }
  245. /* we have a SDRAM0_TR1[RDCT] that is part of the window */
  246. if (j == NUM_TRIES) {
  247. if (first_good == -1)
  248. first_good = i; /* found beginning of window */
  249. } else { /* bad read */
  250. /* if we have not had a good read then don't care */
  251. if(first_good != -1) {
  252. /* first failure after a good read */
  253. last_bad = i-1;
  254. break;
  255. }
  256. }
  257. }
  258. /* return the current value for TR1 */
  259. *tr1_value = (first_good + last_bad) / 2;
  260. }
  261. phys_size_t initdram(int board)
  262. {
  263. register uint reg;
  264. int tr1_bank1, tr1_bank2;
  265. /*--------------------------------------------------------------------
  266. * Setup some default
  267. *------------------------------------------------------------------*/
  268. mtsdram(SDRAM0_UABBA, 0x00000000); /* ubba=0 (default) */
  269. mtsdram(SDRAM0_SLIO, 0x00000000); /* rdre=0 wrre=0 rarw=0 */
  270. mtsdram(SDRAM0_DEVOPT, 0x00000000); /* dll=0 ds=0 (normal) */
  271. mtsdram(SDRAM0_CLKTR, 0x40000000); /* ?? */
  272. mtsdram(SDRAM0_WDDCTR, 0x40000000); /* ?? */
  273. /*clear this first, if the DDR is enabled by a debugger
  274. then you can not make changes. */
  275. mtsdram(SDRAM0_CFG0, 0x00000000); /* Disable EEC */
  276. /*--------------------------------------------------------------------
  277. * Setup for board-specific specific mem
  278. *------------------------------------------------------------------*/
  279. /*
  280. * Following for CAS Latency = 2.5 @ 133 MHz PLB
  281. */
  282. mtsdram(SDRAM0_B0CR, 0x000a4001); /* SDBA=0x000 128MB, Mode 3, enabled */
  283. mtsdram(SDRAM0_B1CR, 0x080a4001); /* SDBA=0x080 128MB, Mode 3, enabled */
  284. mtsdram(SDRAM0_TR0, 0x410a4012); /* ?? */
  285. mtsdram(SDRAM0_RTR, 0x04080000); /* ?? */
  286. mtsdram(SDRAM0_CFG1, 0x00000000); /* Self-refresh exit, disable PM */
  287. mtsdram(SDRAM0_CFG0, 0x30000000); /* Disable EEC */
  288. udelay(400); /* Delay 200 usecs (min) */
  289. /*--------------------------------------------------------------------
  290. * Enable the controller, then wait for DCEN to complete
  291. *------------------------------------------------------------------*/
  292. mtsdram(SDRAM0_CFG0, 0x80000000); /* Enable */
  293. for (;;) {
  294. mfsdram(SDRAM0_MCSTS, reg);
  295. if (reg & 0x80000000)
  296. break;
  297. }
  298. sdram_tr1_set(0x00000000, &tr1_bank1);
  299. sdram_tr1_set(0x08000000, &tr1_bank2);
  300. mtsdram(SDRAM0_TR1, (((tr1_bank1+tr1_bank2)/2) | 0x80800800));
  301. return CONFIG_SYS_SDRAM_BANKS * (CONFIG_SYS_KBYTES_SDRAM * 1024); /* return bytes */
  302. }
  303. /*************************************************************************
  304. * pci_pre_init
  305. *
  306. * This routine is called just prior to registering the hose and gives
  307. * the board the opportunity to check things. Returning a value of zero
  308. * indicates that things are bad & PCI initialization should be aborted.
  309. *
  310. * Different boards may wish to customize the pci controller structure
  311. * (add regions, override default access routines, etc) or perform
  312. * certain pre-initialization actions.
  313. *
  314. ************************************************************************/
  315. #if defined(CONFIG_PCI)
  316. int pci_pre_init(struct pci_controller *hose)
  317. {
  318. unsigned long addr;
  319. /*-------------------------------------------------------------------------+
  320. | Set priority for all PLB3 devices to 0.
  321. | Set PLB3 arbiter to fair mode.
  322. +-------------------------------------------------------------------------*/
  323. mfsdr(SD0_AMP1, addr);
  324. mtsdr(SD0_AMP1, (addr & 0x000000FF) | 0x0000FF00);
  325. addr = mfdcr(PLB3_ACR);
  326. mtdcr(PLB3_ACR, addr | 0x80000000);
  327. /*-------------------------------------------------------------------------+
  328. | Set priority for all PLB4 devices to 0.
  329. +-------------------------------------------------------------------------*/
  330. mfsdr(SD0_AMP0, addr);
  331. mtsdr(SD0_AMP0, (addr & 0x000000FF) | 0x0000FF00);
  332. addr = mfdcr(PLB4_ACR) | 0xa0000000; /* Was 0x8---- */
  333. mtdcr(PLB4_ACR, addr);
  334. /*-------------------------------------------------------------------------+
  335. | Set Nebula PLB4 arbiter to fair mode.
  336. +-------------------------------------------------------------------------*/
  337. /* Segment0 */
  338. addr = (mfdcr(PLB0_ACR) & ~PLB0_ACR_PPM_MASK) | PLB0_ACR_PPM_FAIR;
  339. addr = (addr & ~PLB0_ACR_HBU_MASK) | PLB0_ACR_HBU_ENABLED;
  340. addr = (addr & ~PLB0_ACR_RDP_MASK) | PLB0_ACR_RDP_4DEEP;
  341. addr = (addr & ~PLB0_ACR_WRP_MASK) | PLB0_ACR_WRP_2DEEP;
  342. mtdcr(PLB0_ACR, addr);
  343. /* Segment1 */
  344. addr = (mfdcr(PLB1_ACR) & ~PLB1_ACR_PPM_MASK) | PLB1_ACR_PPM_FAIR;
  345. addr = (addr & ~PLB1_ACR_HBU_MASK) | PLB1_ACR_HBU_ENABLED;
  346. addr = (addr & ~PLB1_ACR_RDP_MASK) | PLB1_ACR_RDP_4DEEP;
  347. addr = (addr & ~PLB1_ACR_WRP_MASK) | PLB1_ACR_WRP_2DEEP;
  348. mtdcr(PLB1_ACR, addr);
  349. return 1;
  350. }
  351. #endif /* defined(CONFIG_PCI) */
  352. /*************************************************************************
  353. * pci_target_init
  354. *
  355. * The bootstrap configuration provides default settings for the pci
  356. * inbound map (PIM). But the bootstrap config choices are limited and
  357. * may not be sufficient for a given board.
  358. *
  359. ************************************************************************/
  360. #if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT)
  361. void pci_target_init(struct pci_controller *hose)
  362. {
  363. /*--------------------------------------------------------------------------+
  364. * Set up Direct MMIO registers
  365. *--------------------------------------------------------------------------*/
  366. /*--------------------------------------------------------------------------+
  367. | PowerPC440 EP PCI Master configuration.
  368. | Map one 1Gig range of PLB/processor addresses to PCI memory space.
  369. | PLB address 0xA0000000-0xDFFFFFFF ==> PCI address 0xA0000000-0xDFFFFFFF
  370. | Use byte reversed out routines to handle endianess.
  371. | Make this region non-prefetchable.
  372. +--------------------------------------------------------------------------*/
  373. out32r(PCIL0_PMM0MA, 0x00000000); /* PMM0 Mask/Attribute - disabled b4 setting */
  374. out32r(PCIL0_PMM0LA, CONFIG_SYS_PCI_MEMBASE); /* PMM0 Local Address */
  375. out32r(PCIL0_PMM0PCILA, CONFIG_SYS_PCI_MEMBASE); /* PMM0 PCI Low Address */
  376. out32r(PCIL0_PMM0PCIHA, 0x00000000); /* PMM0 PCI High Address */
  377. out32r(PCIL0_PMM0MA, 0xE0000001); /* 512M + No prefetching, and enable region */
  378. out32r(PCIL0_PMM1MA, 0x00000000); /* PMM0 Mask/Attribute - disabled b4 setting */
  379. out32r(PCIL0_PMM1LA, CONFIG_SYS_PCI_MEMBASE2); /* PMM0 Local Address */
  380. out32r(PCIL0_PMM1PCILA, CONFIG_SYS_PCI_MEMBASE2); /* PMM0 PCI Low Address */
  381. out32r(PCIL0_PMM1PCIHA, 0x00000000); /* PMM0 PCI High Address */
  382. out32r(PCIL0_PMM1MA, 0xE0000001); /* 512M + No prefetching, and enable region */
  383. out32r(PCIL0_PTM1MS, 0x00000001); /* Memory Size/Attribute */
  384. out32r(PCIL0_PTM1LA, 0); /* Local Addr. Reg */
  385. out32r(PCIL0_PTM2MS, 0); /* Memory Size/Attribute */
  386. out32r(PCIL0_PTM2LA, 0); /* Local Addr. Reg */
  387. /*--------------------------------------------------------------------------+
  388. * Set up Configuration registers
  389. *--------------------------------------------------------------------------*/
  390. /* Program the board's subsystem id/vendor id */
  391. pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
  392. CONFIG_SYS_PCI_SUBSYS_VENDORID);
  393. pci_write_config_word(0, PCI_SUBSYSTEM_ID, CONFIG_SYS_PCI_SUBSYS_ID);
  394. /* Configure command register as bus master */
  395. pci_write_config_word(0, PCI_COMMAND, PCI_COMMAND_MASTER);
  396. /* 240nS PCI clock */
  397. pci_write_config_word(0, PCI_LATENCY_TIMER, 1);
  398. /* No error reporting */
  399. pci_write_config_word(0, PCI_ERREN, 0);
  400. pci_write_config_dword(0, PCI_BRDGOPT2, 0x00000101);
  401. }
  402. #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
  403. /*************************************************************************
  404. * pci_master_init
  405. *
  406. ************************************************************************/
  407. #if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT)
  408. void pci_master_init(struct pci_controller *hose)
  409. {
  410. unsigned short temp_short;
  411. /*--------------------------------------------------------------------------+
  412. | Write the PowerPC440 EP PCI Configuration regs.
  413. | Enable PowerPC440 EP to be a master on the PCI bus (PMM).
  414. | Enable PowerPC440 EP to act as a PCI memory target (PTM).
  415. +--------------------------------------------------------------------------*/
  416. pci_read_config_word(0, PCI_COMMAND, &temp_short);
  417. pci_write_config_word(0, PCI_COMMAND,
  418. temp_short | PCI_COMMAND_MASTER |
  419. PCI_COMMAND_MEMORY);
  420. }
  421. #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT) */
  422. /*************************************************************************
  423. * is_pci_host
  424. *
  425. * This routine is called to determine if a pci scan should be
  426. * performed. With various hardware environments (especially cPCI and
  427. * PPMC) it's insufficient to depend on the state of the arbiter enable
  428. * bit in the strap register, or generic host/adapter assumptions.
  429. *
  430. * Rather than hard-code a bad assumption in the general 440 code, the
  431. * 440 pci code requires the board to decide at runtime.
  432. *
  433. * Return 0 for adapter mode, non-zero for host (monarch) mode.
  434. *
  435. *
  436. ************************************************************************/
  437. #if defined(CONFIG_PCI)
  438. int is_pci_host(struct pci_controller *hose)
  439. {
  440. /* Bamboo is always configured as host. */
  441. return (1);
  442. }
  443. #endif /* defined(CONFIG_PCI) */
  444. /*************************************************************************
  445. * hw_watchdog_reset
  446. *
  447. * This routine is called to reset (keep alive) the watchdog timer
  448. *
  449. ************************************************************************/
  450. #if defined(CONFIG_HW_WATCHDOG)
  451. void hw_watchdog_reset(void)
  452. {
  453. }
  454. #endif
  455. void board_reset(void)
  456. {
  457. /* give reset to BCSR */
  458. *(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x06) = 0x09;
  459. }