1 #include <ppc_asm.tmpl>
7 #define USE_V2_INIT 1 /* Jimmy Blair's initialization. */
11 * Initialize the MMU using BAT entries and hardwired TLB
12 * This obviates the need for any code in cpu_init_f which
13 * configures the BAT registers.
15 #define MEMORY_MGMT_MSR_BITS (MSR_DR | MSR_IR) /* Data and Inst Relocate */
17 /* Initialize IO/MMU mappings via BAT method Ch. 7,
18 * PPC Programming Reference
22 /* initialize the BAT registers (SPRs 528 - 543 */
23 #define mtibat0u(x) mtspr 528,(x) /* SPR 528 (IBAT0U) */
24 #define mtibat0l(x) mtspr 529,(x) /* SPR 529 (IBAT0L) */
25 #define mtibat1u(x) mtspr 530,(x) /* SPR 530 (IBAT1U) */
26 #define mtibat1l(x) mtspr 531,(x) /* SPR 531 (IBAT1L) */
27 #define mtibat2u(x) mtspr 532,(x) /* SPR 532 (IBAT2U) */
28 #define mtibat2l(x) mtspr 533,(x) /* SPR 533 (IBAT2L) */
29 #define mtibat3u(x) mtspr 534,(x) /* SPR 534 (IBAT3U) */
30 #define mtibat3l(x) mtspr 535,(x) /* SPR 535 (IBAT3L) */
31 #define mtdbat0u(x) mtspr 536,(x) /* SPR 536 (DBAT0U) */
32 #define mtdbat0l(x) mtspr 537,(x) /* SPR 537 (DBAT0L) */
33 #define mtdbat1u(x) mtspr 538,(x) /* SPR 538 (DBAT1U) */
34 #define mtdbat1l(x) mtspr 539,(x) /* SPR 539 (DBAT1L) */
35 #define mtdbat2u(x) mtspr 540,(x) /* SPR 540 (DBAT2U) */
36 #define mtdbat2l(x) mtspr 541,(x) /* SPR 541 (DBAT2L) */
37 #define mtdbat3u(x) mtspr 542,(x) /* SPR 542 (DBAT3U) */
38 #define mtdbat3l(x) mtspr 543,(x) /* SPR 543 (DBAT3L) */
41 /* PowerPC processors do not necessarily initialize the BAT
42 registers on power-up or reset. So they are in an unknown
43 state. Before programming the BATs for the first time, all
44 BAT registers MUST have their Vs and Vp bits cleared in the
45 upper BAT half in order to avoid possibly having 2 BATs
46 valid and mapping the same memory region.
48 The reason for this is that, even with address translation
49 disabled, multiple BAT hits for an address are treated as
50 programming errors and can cause unpredictable results.
52 It is up to the software to make sure it never has 2 IBAT
53 mappings or 2 DBAT mappings that are valid for the same
54 addresses. It is not necessary to perform this code
55 sequence every time the BATs are programmed, only when
56 there is a possibility that there may be overlapping BAT
59 When programming the BATs in non-reset scenarios, even if
60 you are sure that your new mapping will not temporarily
61 create overlapping regions, it is still a wise idea to
62 invalidate a BAT entry by setting its upper BAT register to
63 all 0's before programming it. This will avoid having a
64 BAT marked valid that is in an unknown or transient state
90 ori r4, r4, CFG_DBAT0L@l
92 ori r3, r3, CFG_DBAT0U@l
101 ori r4, r4, CFG_IBAT0L@l
103 ori r3, r3, CFG_IBAT0U@l
115 ori r4, r4, CFG_IBAT1L@l
117 ori r3, r3, CFG_IBAT1U@l
134 ori r4, r4, CFG_IBAT2L@l
136 ori r3, r3, CFG_IBAT2U@l
153 ori r4, r4, CFG_IBAT3L@l
155 ori r3, r3, CFG_IBAT3U@l
170 * Invalidate all 64 TLB's
186 * Enable Data Translation
188 lis r4, MEMORY_MGMT_MSR_BITS@h
189 ori r4, r4, MEMORY_MGMT_MSR_BITS@l
200 /* #define USER_I_CACHE_ENABLE 1*/ /* Fast rom boots */
201 /* Macro for hiadjust and lo */
202 #define HIADJ(arg) arg@ha
203 #define HI(arg) arg@h
204 #define LO(arg) arg@l
207 #define LOADPTR(reg,const32) \
208 addis reg,r0,HIADJ(const32); addi reg,reg,LO(const32)
213 /* MPC8245/BMW CPCI System Init
214 * Jimmy Blair, Broadcom Corp, 2002.
217 /* Zero-out registers */
225 /* Set MPU/MSR to a known state. Turn on FP */
232 /* Init the floating point control/status register */
244 /* Set MPU/MSR to a known state. Turn off FP */
246 #if 1 /* Turn off floating point (remove to keep FP on) */
253 /* Init the Segment registers */
290 /* Turn off data and instruction cache control bits */
294 rlwinm r4, r3, 0, 18, 15 /* r4 has ICE and DCE bits cleared */
297 mtspr HID0, r4 /* HID0 = r4 */
303 rlwinm r28, r28, 16, 16, 31
305 /* invalidate the MPU's data/instruction caches */
308 cmpli 0, 0, r28, CPU_TYPE_603
310 cmpli 0, 0, r28, CPU_TYPE_603E
312 cmpli 0, 0, r28, CPU_TYPE_603P
314 cmpli 0, 0, r28, CPU_TYPE_604R
319 mtspr HID0, r3 /* disable the caches */
321 ori r4, r4, 0x0002 /* disable BTAC by setting bit 30 */
324 ori r3, r3, (HID0_ICFI |HID0_DCI)
327 ori r3, r3, (HID0_ICE | HID0_DCE)
328 or r4, r4, r3 /* set bits */
331 mtspr HID0, r4 /* HID0 = r4 */
332 andc r4, r4, r3 /* clear bits */
334 cmpli 0, 0, r28, CPU_TYPE_604
336 cmpli 0, 0, r28, CPU_TYPE_604E
338 cmpli 0, 0, r28, CPU_TYPE_604R
343 #ifdef USER_I_CACHE_ENABLE
350 LOADPTR (r5, 0x1000) /* loop count, 0x1000 */
359 /* turn the Instruction cache ON for faster FLASH ROM boots */
361 #ifdef USER_I_CACHE_ENABLE
363 ori r4, r4, (HID0_ICE | HID0_ICFI)
364 isync /* Synchronize for ICE enable */
367 ori r4, r4, (HID0_ICE | HID0_ICFI)
368 rlwinm r3, r4, 0, 21, 19 /* clear the ICFI bit */
371 * The setting of the instruction cache enable (ICE) bit must be
372 * preceded by an isync instruction to prevent the cache from being
373 * enabled or disabled while an instruction access is in progress.
377 mtspr HID0, r4 /* Enable Instr Cache & Inval cache */
378 cmpli 0, 0, r28, CPU_TYPE_604
380 cmpli 0, 0, r28, CPU_TYPE_604E
383 mtspr HID0, r3 /* using 2 consec instructions */
384 /* PPC603 recommendation */
388 /* Detect map A or B */
390 addis r5,r0, HI(CHRP_REG_ADDR)
391 addis r6,r0, HI(CHRP_REG_DATA)
392 LOADPTR (r7, KAHLUA_ID) /* Kahlua PCI controller ID */
393 LOADPTR (r8, BMC_BASE)
396 lwbrx r3,0,(r6) /* Store read value to r3 */
398 beq cr0, X4_KAHLUA_START
400 /* It's not an 8240, is it an 8245? */
402 LOADPTR (r7, KAHLUA2_ID) /* Kahlua PCI controller ID */
404 beq cr0, X4_KAHLUA_START
406 /* Save the PCI controller type in r7 */
409 LOADPTR (r5, PREP_REG_ADDR)
410 LOADPTR (r6, PREP_REG_DATA)
413 /* MPC8245 changes begin here */
414 LOADPTR (r3, MPC107_PCI_CMD) /* PCI command reg */
416 li r4, 6 /* Command register value */
419 LOADPTR (r3, MPC107_PCI_STAT) /* PCI status reg */
421 li r4, -1 /* Write-to-clear all bits */
422 li r3, 2 /* PCI_STATUS is at +2 offset */
425 /*-------PROC_INT1_ADR */
427 LOADPTR (r3, PROC_INT1_ADR) /* Processor I/F Config 1 reg. */
429 LOADPTR (r4, 0xff141b98)
432 /*-------PROC_INT2_ADR */
434 LOADPTR (r3, PROC_INT2_ADR) /* Processor I/F Config 2 reg. */
436 lis r4, 0x2000 /* Flush PCI config writes */
439 LOADPTR (r9, KAHLUA2_ID)
443 /* MIOCR1 -- turn on bit for DLL delay */
445 LOADPTR (r3, MIOCR1_ADR_X)
448 stb r4, MIOCR1_SHIFT(r6)
450 /* For the MPC8245, set register 77 to %00100000 (see Errata #15) */
451 /* SDRAM_CLK_DEL (0x77)*/
453 LOADPTR (r3, MIOCR2_ADR_X)
456 stb r4, MIOCR2_SHIFT(r6)
458 /* PMCR2 -- set PCI hold delay to <10>b for 33 MHz */
460 LOADPTR (r3, PMCR2_ADR_X)
463 stb r4, PMCR2_SHIFT(r6)
465 /* Initialize EUMBBAR early since 8245 has internal UART in EUMB */
467 LOADPTR (r3, EUMBBAR)
469 LOADPTR (r4, CFG_EUMB_ADDR)
474 /* Toggle the DLL reset bit in AMBOR */
481 stb r4, 0(r6) /* Clear DLL_RESET */
484 ori r4, r4, 0x20 /* Set DLL_RESET */
489 stb r4, 0(r6) /* Clear DLL_RESET */
492 /* Enable RCS2, use supplied timings */
495 LOADPTR (r4, 0x80408000)
498 /* Disable RCS3 parameters */
501 LOADPTR (r4, 0x00000000)
504 /* RCS3 at 0x70000000, 64KBytes */
507 LOADPTR (r4, 0x00000004)
514 #else /* INCLUDE_ECC */
516 #endif /* INCLUDE_ECC */
518 #define MC1_ROMNAL 8 /* 0-15 */
519 #define MC1_ROMFAL 11 /* 0-31 */
520 #define MC1_DBUS_SIZE 0 /* 0-3, read only */
521 #define MC1_BURST 0 /* 0-1 */
522 #define MC1_MEMGO 0 /* 0-1 */
523 #define MC1_SREN 1 /* 0-1 */
524 #define MC1_RAM_TYPE 0 /* 0-1 */
525 #define MC1_PCKEN MC_ECC /* 0-1 */
526 #define MC1_BANKBITS 0x5555 /* 2 bits/bank 7-0 */
528 LOADPTR (r3, MEM_CONT1_ADR) /* Set MCCR1 (F0) */
531 MC1_ROMNAL << 28 | MC1_ROMFAL << 23 | \
532 MC1_DBUS_SIZE << 21 | MC1_BURST << 20 | \
533 MC1_MEMGO << 19 | MC1_SREN << 18 | \
534 MC1_RAM_TYPE << 17 | MC1_PCKEN << 16 )
536 cmpl 0, 0, r7, r9 /* Check for Kahlua2 */
538 cmpli 0, 0, r3, 0x5555
539 beq K2BankBitsHack /* On 8245, 5555 ==> 0 */
547 #define MC2_TS_WAIT_TIMER 0 /* 0-7 */
548 #define MC2_ASRISE 8 /* 0-15 */
549 #define MC2_ASFALL 4 /* 0-15 */
550 #define MC2_INLINE_PAR_NOT_ECC 0 /* 0-1 */
551 #define MC2_WRITE_PARITY_CHK_EN MC_ECC /* 0-1 */
552 #define MC2_INLRD_PARECC_CHK_EN MC_ECC /* 0-1 */
553 #define MC2_ECC_EN 0 /* 0-1 */
554 #define MC2_EDO 0 /* 0-1 */
556 * N.B. This refresh interval looks good up to 85 MHz with Hynix SDRAM.
557 * May need to be decreased for 100 MHz
559 #define MC2_REFINT 0x3a5 /* 0-0x3fff */
560 #define MC2_RSV_PG 0 /* 0-1 */
561 #define MC2_RMW_PAR MC_ECC /* 0-1 */
563 LOADPTR (r3, MEM_CONT2_ADR) /* Set MCCR2 (F4) */
566 MC2_TS_WAIT_TIMER << 29 | MC2_ASRISE << 25 | \
567 MC2_ASFALL << 21 | MC2_INLINE_PAR_NOT_ECC << 20 | \
568 MC2_WRITE_PARITY_CHK_EN << 19 | \
569 MC2_INLRD_PARECC_CHK_EN << 18 | \
570 MC2_ECC_EN << 17 | MC2_EDO << 16 | \
571 MC2_REFINT << 2 | MC2_RSV_PG << 1 | MC2_RMW_PAR)
572 cmpl 0, 0, r7, r9 /* Check for Kahlua2 */
574 /* clear Kahlua2 reserved bits */
575 LOADPTR (r3, 0xfffcffff)
582 #define MC_BSTOPRE 0x079 /* 0-0x7ff */
584 #define MC3_BSTOPRE_U (MC_BSTOPRE >> 4 & 0xf)
585 #define MC3_REFREC 8 /* 0-15 */
586 #define MC3_RDLAT (4+MC_ECC) /* 0-15 */
587 #define MC3_CPX 0 /* 0-1 */
588 #define MC3_RAS6P 0 /* 0-15 */
589 #define MC3_CAS5 0 /* 0-7 */
590 #define MC3_CP4 0 /* 0-7 */
591 #define MC3_CAS3 0 /* 0-7 */
592 #define MC3_RCD2 0 /* 0-7 */
593 #define MC3_RP1 0 /* 0-7 */
595 LOADPTR (r3, MEM_CONT3_ADR) /* Set MCCR3 (F8) */
598 MC3_BSTOPRE_U << 28 | MC3_REFREC << 24 | \
599 MC3_RDLAT << 20 | MC3_CPX << 19 | \
600 MC3_RAS6P << 15 | MC3_CAS5 << 12 | MC3_CP4 << 9 | \
601 MC3_CAS3 << 6 | MC3_RCD2 << 3 | MC3_RP1)
602 cmpl 0, 0, r7, r9 /* Check for Kahlua2 */
604 /* clear Kahlua2 reserved bits */
605 LOADPTR (r3, 0xff000000)
612 #define MC4_PRETOACT 3 /* 0-15 */
613 #define MC4_ACTOPRE 5 /* 0-15 */
614 #define MC4_WMODE 0 /* 0-1 */
615 #define MC4_INLINE MC_ECC /* 0-1 */
616 #define MC4_REGISTERED (1-MC_ECC) /* 0-1 */
617 #define MC4_BSTOPRE_UU (MC_BSTOPRE >> 8 & 3)
618 #define MC4_REGDIMM 0 /* 0-1 */
619 #define MC4_SDMODE_CAS 2 /* 0-7 */
620 #define MC4_DBUS_RCS1 1 /* 0-1, 8-bit */
621 #define MC4_SDMODE_WRAP 0 /* 0-1 */
622 #define MC4_SDMODE_BURST 2 /* 0-7 */
623 #define MC4_ACTORW 3 /* 0-15 */
624 #define MC4_BSTOPRE_L (MC_BSTOPRE & 0xf)
626 LOADPTR (r3, MEM_CONT4_ADR) /* Set MCCR4 (FC) */
629 MC4_PRETOACT << 28 | MC4_ACTOPRE << 24 | \
630 MC4_WMODE << 23 | MC4_INLINE << 22 | \
631 MC4_REGISTERED << 20 | MC4_BSTOPRE_UU << 18 | \
632 MC4_DBUS_RCS1 << 17 | \
633 MC4_REGDIMM << 15 | MC4_SDMODE_CAS << 12 | \
634 MC4_SDMODE_WRAP << 11 | MC4_SDMODE_BURST << 8 | \
635 MC4_ACTORW << 4 | MC4_BSTOPRE_L)
636 cmpl 0, 0, r7, r9 /* Check for Kahlua 2 */
638 /* Turn on Kahlua2 extended ROM space */
639 LOADPTR (r3, 0x00200000)
645 /*------- MEM_ERREN1 */
647 LOADPTR (r3, MEM_ERREN1_ADR) /* Set MEM_ERREN1 (c0) */
650 ori r4,r4,4 /* Set MEM_PERR_EN */
652 #endif /* INCLUDE_ECC */
654 /*------- MSAR/MEAR */
656 LOADPTR (r3, MEM_START1_ADR) /* Set MSAR1 (80) */
658 LOADPTR (r4, 0xc0804000)
661 LOADPTR (r3, MEM_START2_ADR) /* Set MSAR2 (84) */
663 LOADPTR (r4, 0xc0804000)
666 LOADPTR (r3, XMEM_START1_ADR) /* Set MESAR1 (88) */
668 LOADPTR (r4, 0x00000000)
671 LOADPTR (r3, XMEM_START2_ADR) /* Set MESAR2 (8c) */
673 LOADPTR (r4, 0x01010101)
676 LOADPTR (r3, MEM_END1_ADR) /* Set MEAR1 (90) */
678 LOADPTR (r4, 0xffbf7f3f)
681 LOADPTR (r3, MEM_END2_ADR) /* Set MEAR2 (94) */
683 LOADPTR (r4, 0xffbf7f3f)
686 LOADPTR (r3, XMEM_END1_ADR) /* MEEAR1 (98) */
688 LOADPTR (r4, 0x00000000)
691 LOADPTR (r3, XMEM_END2_ADR) /* MEEAR2 (9c) */
693 LOADPTR (r4, 0x01010101)
698 LOADPTR (r3, ODCR_ADR_X) /* Set ODCR */
702 stb r4, ODCR_SHIFT(r6) /* ODCR is at +3 offset */
706 LOADPTR (r3, MEM_EN_ADR) /* Set MBEN (a0) */
708 li r4, 0x01 /* Enable bank 0 */
709 stb r4, 0(r6) /* MBEN is at +0 offset */
711 #if 0 /* Jimmy: I think page made is broken */
714 LOADPTR (r3, MPM_ADR_X)
717 stb r4, MPM_SHIFT(r6) /* PAGE_MODE is at +3 offset */
720 /* Wait before initializing other registers */
726 bdnz KahluaX4wait200us
730 LOADPTR (r3, MEM_CONT1_ADR) /* MCCR1 (F0) |= PGMAX */
732 lwbrx r4,0,r6 /* old MCCR1 */
733 oris r4,r4,0x0008 /* MEMGO=1 */
744 bdnz KahluaX4wait8ref
751 #else /* USE_V2_INIT */
754 /* U-Boot works, but memory will not run reliably for all address ranges.
755 * Early U-Boot Working init, but 2.4.19 kernel will crash since memory is not
756 * initialized correctly. Could work if debugged.
758 /* PCI Support routines */
760 .globl __pci_config_read_32
761 __pci_config_read_32:
768 .globl __pci_config_read_16
769 __pci_config_read_16:
777 .globl __pci_config_read_8
786 .globl __pci_config_write_32
787 __pci_config_write_32:
795 .globl __pci_config_write_16
796 __pci_config_write_16:
805 .globl __pci_config_write_8
806 __pci_config_write_8:
903 /* PCI Latency Timer */
906 bl __pci_config_write_8
908 /* Cache Line Size */
911 bl __pci_config_write_8
916 bl __pci_config_write_16
921 bl __pci_config_read_16
924 bl __pci_config_write_16
931 bl __pci_config_write_32
938 bl __pci_config_write_32
942 ori r3, r10, MIOCR1@l
943 bl __pci_config_write_8
945 /* For the MPC8245, set register 77 to %00100000 (see Errata #15) */
946 /* SDRAM_CLK_DEL (0x77)*/
948 ori r3, r10, MIOCR2@l
949 bl __pci_config_write_8
953 ori r3, r10, EUMBBAR@l
954 bl __pci_config_write_32
958 /* Even if Address Map B is not being used (though it should),
959 * the memory DLL needs to be cleared/set/cleared before using memory.
963 bl __pci_config_read_8 /* get Current bits */
967 bl __pci_config_write_16 /* Clear DLL_RESET */
971 bl __pci_config_write_16 /* Set DLL_RESET */
975 bl __pci_config_write_16 /* Clear DLL_RESET */
978 lis r4, 0x8040 /* Enable RCS2, use supplied timings */
981 bl __pci_config_write_32
984 lis r4, 0x0000 /* Disable RCS3 parms */
987 bl __pci_config_write_32
990 lis r4, 0x0000 /* RCS3 at 0x70000000, 64K bytes */
993 bl __pci_config_write_32
995 /* Preserve memgo bit */
998 /* lis r4, 0x75a8 / Safe Local ROM = 11+3 clocks */
999 lis r4, 0x75a0 /* Safe Local ROM = 11+3 clocks */
1000 /* lis r4, 0x73a0 / Fast Local ROM = 7+3 clocks */
1001 /* oris r4, r4, 0x0010 / Burst ROM/Flash enable */
1002 /* oris r4, r4, 0x0004 / Self-refresh enable */
1004 /* ori r4,r4,0xFFFF / 16Mbit 2bank SDRAM */
1005 /* ori r4,r4,0xAAAA / 256Mbit 4bank SDRAM (8245 only) */
1006 /* ori r4,r4,0x5555 / 64Mbit 2bank SDRAM */
1007 ori r4,r4,0x0000 /* 64Mbit 4bank SDRAM */
1009 ori r3, r10, MCCR1@l
1010 bl __pci_config_write_32
1015 /* oris r4,r4,0x4000 / TS_WAIT_TIMER = 3 clocks */
1016 oris r4,r4,0x1000 /* ASRISE = 8 clocks */
1017 oris r4,r4,0x0080 /* ASFALL = 8 clocks */
1018 /* oris r4,r4,0x0010 / SDRAM Parity (else ECC) */
1019 /* oris r4,r4,0x0008 / Write parity check */
1020 /* oris r4,r4,0x0004 / SDRAM inline reads */
1023 /* Select a refresh rate; it needs to match the bus speed; if too */
1024 /* slow, data may be lost; if too fast, performance is lost. We */
1025 /* use the fastest value so we run at all speeds. */
1026 /* Refresh = (15600ns/busclk) - (213 (see UM)). */
1028 /* ori r4,r4,0x1d2c / 133 MHz mem bus = 1867 */
1029 /* ori r4,r4,0x150c / 100 MHz mem bus = 1347 */
1030 /* ori r4,r4,0x10fc / 83 MHz mem bus = 1087 */
1031 /* ori r4,r4,0x0cc4 / 66 MHz mem bus = 817 */
1032 ori r4,r4,0x04cc /* 33 MHz mem bus (SAFE) = 307 */
1033 /* ori r4,r4,0x0002 / Reserve a page */
1034 /* ori r4,r4,0x0001 / RWM parity */
1036 ori r3, r10, MCCR2@l
1037 bl __pci_config_write_32
1041 lis r4,0x0000 /* BSTOPRE_M = 7 (see A/N) */
1042 oris r4,r4,0x0500 /* REFREC = 8 clocks */
1043 ori r3, r10, MCCR3@l
1044 bl __pci_config_write_32
1046 /* MCCR4 */ /* Turn on registered buffer mode */
1047 lis r4, 0x2000 /* PRETOACT = 3 clocks */
1048 oris r4,r4,0x0400 /* ACTOPRE = 5 clocks */
1049 /* oris r4,r4,0x0080 / Enable 8-beat burst (32-bit bus) */
1050 /* oris r4,r4,0x0040 / Enable Inline ECC/Parity */
1051 oris r4,r4,0x0020 /* EXTROM enabled */
1052 oris r4,r4,0x0010 /* Registered buffers */
1053 /* oris r4,r4,0x0000 / BSTOPRE_U = 0 (see A/N) */
1054 oris r4,r4,0x0002 /* DBUS_SIZ[2] (8 bit on RCS1) */
1056 /* ori r4,r4,0x8000 / Registered DIMMs */
1057 ori r4,r4,0x2000 /*CAS Latency (CL=3) (see RDLAT) */
1058 /* ori r4,r4,0x2000 / CAS Latency (CL=2) (see RDLAT) */
1059 /* ori r4,r4,0x0300 / Sequential wrap/8-beat burst */
1060 ori r4,r4,0x0200 /* Sequential wrap/4-beat burst */
1061 ori r4,r4,0x0030 /* ACTORW = 3 clocks */
1062 ori r4,r4,0x0009 /* BSTOPRE_L = 9 (see A/N) */
1064 ori r3, r10, MCCR4@l
1065 bl __pci_config_write_32
1068 lis r4, 0xc0804000@h
1069 ori r4, r4, 0xc0804000@l
1070 ori r3, r10, MSAR1@l
1071 bl __pci_config_write_32
1074 lis r4, 0xc0804000@h
1075 ori r4, r4, 0xc0804000@l
1076 ori r3, r10, MSAR2@l
1077 bl __pci_config_write_32
1080 lis r4, 0x00000000@h
1081 ori r4, r4, 0x00000000@l
1082 ori r3, r10, EMSAR1@l
1083 bl __pci_config_write_32
1086 lis r4, 0x01010101@h
1087 ori r4, r4, 0x01010101@l
1088 ori r3, r10, EMSAR2@l
1089 bl __pci_config_write_32
1092 lis r4, 0xffbf7f3f@h
1093 ori r4, r4, 0xffbf7f3f@l
1094 ori r3, r10, MEAR1@l
1095 bl __pci_config_write_32
1098 lis r4, 0xffbf7f3f@h
1099 ori r4, r4, 0xffbf7f3f@l
1100 ori r3, r10, MEAR2@l
1101 bl __pci_config_write_32
1104 lis r4, 0x00000000@h
1105 ori r4, r4, 0x00000000@l
1106 ori r3, r10, EMEAR1@l
1107 bl __pci_config_write_32
1110 lis r4, 0x01010101@h
1111 ori r4, r4, 0x01010101@l
1112 ori r3, r10, EMEAR2@l
1113 bl __pci_config_write_32
1118 bl __pci_config_write_8
1123 bl __pci_config_write_8
1125 /* Page CTR aka PGMAX */
1128 bl __pci_config_write_8
1132 ori r4, r10, 0xfc01 /* Top bit will be ignored */
1134 bl __pci_config_write_16
1144 ori r3, r10, MCCR1@l
1145 bl __pci_config_read_32
1148 ori r3, r10, MCCR1@l
1149 bl __pci_config_write_32
1156 /* DEBUG: Infinite loop, write then read */