2 * QEMU PowerPC 4xx embedded processors shared devices emulation
4 * Copyright (c) 2007 Jocelyn Mayer
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 #include "qemu/osdep.h"
25 #include "qemu/units.h"
28 #include "hw/ppc/ppc.h"
29 #include "hw/ppc/ppc4xx.h"
30 #include "hw/boards.h"
32 #include "exec/address-spaces.h"
33 #include "qemu/error-report.h"
39 # define LOG_UIC(...) qemu_log_mask(CPU_LOG_INT, ## __VA_ARGS__)
41 # define LOG_UIC(...) do { } while (0)
44 static void ppc4xx_reset(void *opaque
)
46 PowerPCCPU
*cpu
= opaque
;
51 /*****************************************************************************/
52 /* Generic PowerPC 4xx processor instantiation */
53 PowerPCCPU
*ppc4xx_init(const char *cpu_type
,
54 clk_setup_t
*cpu_clk
, clk_setup_t
*tb_clk
,
61 cpu
= POWERPC_CPU(cpu_create(cpu_type
));
64 cpu_clk
->cb
= NULL
; /* We don't care about CPU clock frequency changes */
65 cpu_clk
->opaque
= env
;
66 /* Set time-base frequency to sysclk */
67 tb_clk
->cb
= ppc_40x_timers_init(env
, sysclk
, PPC_INTERRUPT_PIT
);
69 ppc_dcr_init(env
, NULL
, NULL
);
70 /* Register qemu callbacks */
71 qemu_register_reset(ppc4xx_reset
, cpu
);
76 /*****************************************************************************/
77 /* "Universal" Interrupt controller */
91 #define UIC_MAX_IRQ 32
92 typedef struct ppcuic_t ppcuic_t
;
96 uint32_t level
; /* Remembers the state of level-triggered interrupts. */
97 uint32_t uicsr
; /* Status register */
98 uint32_t uicer
; /* Enable register */
99 uint32_t uiccr
; /* Critical register */
100 uint32_t uicpr
; /* Polarity register */
101 uint32_t uictr
; /* Triggering register */
102 uint32_t uicvcr
; /* Vector configuration register */
107 static void ppcuic_trigger_irq (ppcuic_t
*uic
)
110 int start
, end
, inc
, i
;
112 /* Trigger interrupt if any is pending */
113 ir
= uic
->uicsr
& uic
->uicer
& (~uic
->uiccr
);
114 cr
= uic
->uicsr
& uic
->uicer
& uic
->uiccr
;
115 LOG_UIC("%s: uicsr %08" PRIx32
" uicer %08" PRIx32
116 " uiccr %08" PRIx32
"\n"
117 " %08" PRIx32
" ir %08" PRIx32
" cr %08" PRIx32
"\n",
118 __func__
, uic
->uicsr
, uic
->uicer
, uic
->uiccr
,
119 uic
->uicsr
& uic
->uicer
, ir
, cr
);
120 if (ir
!= 0x0000000) {
121 LOG_UIC("Raise UIC interrupt\n");
122 qemu_irq_raise(uic
->irqs
[PPCUIC_OUTPUT_INT
]);
124 LOG_UIC("Lower UIC interrupt\n");
125 qemu_irq_lower(uic
->irqs
[PPCUIC_OUTPUT_INT
]);
127 /* Trigger critical interrupt if any is pending and update vector */
128 if (cr
!= 0x0000000) {
129 qemu_irq_raise(uic
->irqs
[PPCUIC_OUTPUT_CINT
]);
130 if (uic
->use_vectors
) {
131 /* Compute critical IRQ vector */
132 if (uic
->uicvcr
& 1) {
141 uic
->uicvr
= uic
->uicvcr
& 0xFFFFFFFC;
142 for (i
= start
; i
<= end
; i
+= inc
) {
144 uic
->uicvr
+= (i
- start
) * 512 * inc
;
149 LOG_UIC("Raise UIC critical interrupt - "
150 "vector %08" PRIx32
"\n", uic
->uicvr
);
152 LOG_UIC("Lower UIC critical interrupt\n");
153 qemu_irq_lower(uic
->irqs
[PPCUIC_OUTPUT_CINT
]);
154 uic
->uicvr
= 0x00000000;
158 static void ppcuic_set_irq (void *opaque
, int irq_num
, int level
)
164 mask
= 1U << (31-irq_num
);
165 LOG_UIC("%s: irq %d level %d uicsr %08" PRIx32
166 " mask %08" PRIx32
" => %08" PRIx32
" %08" PRIx32
"\n",
167 __func__
, irq_num
, level
,
168 uic
->uicsr
, mask
, uic
->uicsr
& mask
, level
<< irq_num
);
169 if (irq_num
< 0 || irq_num
> 31)
173 /* Update status register */
174 if (uic
->uictr
& mask
) {
175 /* Edge sensitive interrupt */
179 /* Level sensitive interrupt */
188 LOG_UIC("%s: irq %d level %d sr %" PRIx32
" => "
189 "%08" PRIx32
"\n", __func__
, irq_num
, level
, uic
->uicsr
, sr
);
190 if (sr
!= uic
->uicsr
)
191 ppcuic_trigger_irq(uic
);
194 static uint32_t dcr_read_uic (void *opaque
, int dcrn
)
200 dcrn
-= uic
->dcr_base
;
219 ret
= uic
->uicsr
& uic
->uicer
;
222 if (!uic
->use_vectors
)
227 if (!uic
->use_vectors
)
240 static void dcr_write_uic (void *opaque
, int dcrn
, uint32_t val
)
245 dcrn
-= uic
->dcr_base
;
246 LOG_UIC("%s: dcr %d val 0x%x\n", __func__
, dcrn
, val
);
250 uic
->uicsr
|= uic
->level
;
251 ppcuic_trigger_irq(uic
);
255 ppcuic_trigger_irq(uic
);
259 ppcuic_trigger_irq(uic
);
263 ppcuic_trigger_irq(uic
);
270 ppcuic_trigger_irq(uic
);
277 uic
->uicvcr
= val
& 0xFFFFFFFD;
278 ppcuic_trigger_irq(uic
);
283 static void ppcuic_reset (void *opaque
)
288 uic
->uiccr
= 0x00000000;
289 uic
->uicer
= 0x00000000;
290 uic
->uicpr
= 0x00000000;
291 uic
->uicsr
= 0x00000000;
292 uic
->uictr
= 0x00000000;
293 if (uic
->use_vectors
) {
294 uic
->uicvcr
= 0x00000000;
295 uic
->uicvr
= 0x0000000;
299 qemu_irq
*ppcuic_init (CPUPPCState
*env
, qemu_irq
*irqs
,
300 uint32_t dcr_base
, int has_ssr
, int has_vr
)
305 uic
= g_malloc0(sizeof(ppcuic_t
));
306 uic
->dcr_base
= dcr_base
;
309 uic
->use_vectors
= 1;
310 for (i
= 0; i
< DCR_UICMAX
; i
++) {
311 ppc_dcr_register(env
, dcr_base
+ i
, uic
,
312 &dcr_read_uic
, &dcr_write_uic
);
314 qemu_register_reset(ppcuic_reset
, uic
);
316 return qemu_allocate_irqs(&ppcuic_set_irq
, uic
, UIC_MAX_IRQ
);
319 /*****************************************************************************/
320 /* SDRAM controller */
321 typedef struct ppc4xx_sdram_t ppc4xx_sdram_t
;
322 struct ppc4xx_sdram_t
{
325 MemoryRegion containers
[4]; /* used for clipping */
326 MemoryRegion
*ram_memories
;
344 SDRAM0_CFGADDR
= 0x010,
345 SDRAM0_CFGDATA
= 0x011,
348 /* XXX: TOFIX: some patches have made this code become inconsistent:
349 * there are type inconsistencies, mixing hwaddr, target_ulong
352 static uint32_t sdram_bcr (hwaddr ram_base
,
380 printf("%s: invalid RAM size " TARGET_FMT_plx
"\n", __func__
,
384 bcr
|= ram_base
& 0xFF800000;
390 static inline hwaddr
sdram_base(uint32_t bcr
)
392 return bcr
& 0xFF800000;
395 static target_ulong
sdram_size (uint32_t bcr
)
400 sh
= (bcr
>> 17) & 0x7;
404 size
= (4 * MiB
) << sh
;
409 static void sdram_set_bcr(ppc4xx_sdram_t
*sdram
,
410 uint32_t *bcrp
, uint32_t bcr
, int enabled
)
412 unsigned n
= bcrp
- sdram
->bcr
;
414 if (*bcrp
& 0x00000001) {
417 printf("%s: unmap RAM area " TARGET_FMT_plx
" " TARGET_FMT_lx
"\n",
418 __func__
, sdram_base(*bcrp
), sdram_size(*bcrp
));
420 memory_region_del_subregion(get_system_memory(),
421 &sdram
->containers
[n
]);
422 memory_region_del_subregion(&sdram
->containers
[n
],
423 &sdram
->ram_memories
[n
]);
424 object_unparent(OBJECT(&sdram
->containers
[n
]));
426 *bcrp
= bcr
& 0xFFDEE001;
427 if (enabled
&& (bcr
& 0x00000001)) {
429 printf("%s: Map RAM area " TARGET_FMT_plx
" " TARGET_FMT_lx
"\n",
430 __func__
, sdram_base(bcr
), sdram_size(bcr
));
432 memory_region_init(&sdram
->containers
[n
], NULL
, "sdram-containers",
434 memory_region_add_subregion(&sdram
->containers
[n
], 0,
435 &sdram
->ram_memories
[n
]);
436 memory_region_add_subregion(get_system_memory(),
438 &sdram
->containers
[n
]);
442 static void sdram_map_bcr (ppc4xx_sdram_t
*sdram
)
446 for (i
= 0; i
< sdram
->nbanks
; i
++) {
447 if (sdram
->ram_sizes
[i
] != 0) {
450 sdram_bcr(sdram
->ram_bases
[i
], sdram
->ram_sizes
[i
]),
453 sdram_set_bcr(sdram
, &sdram
->bcr
[i
], 0x00000000, 0);
458 static void sdram_unmap_bcr (ppc4xx_sdram_t
*sdram
)
462 for (i
= 0; i
< sdram
->nbanks
; i
++) {
464 printf("%s: Unmap RAM area " TARGET_FMT_plx
" " TARGET_FMT_lx
"\n",
465 __func__
, sdram_base(sdram
->bcr
[i
]), sdram_size(sdram
->bcr
[i
]));
467 memory_region_del_subregion(get_system_memory(),
468 &sdram
->ram_memories
[i
]);
472 static uint32_t dcr_read_sdram (void *opaque
, int dcrn
)
474 ppc4xx_sdram_t
*sdram
;
483 switch (sdram
->addr
) {
484 case 0x00: /* SDRAM_BESR0 */
487 case 0x08: /* SDRAM_BESR1 */
490 case 0x10: /* SDRAM_BEAR */
493 case 0x20: /* SDRAM_CFG */
496 case 0x24: /* SDRAM_STATUS */
499 case 0x30: /* SDRAM_RTR */
502 case 0x34: /* SDRAM_PMIT */
505 case 0x40: /* SDRAM_B0CR */
508 case 0x44: /* SDRAM_B1CR */
511 case 0x48: /* SDRAM_B2CR */
514 case 0x4C: /* SDRAM_B3CR */
517 case 0x80: /* SDRAM_TR */
520 case 0x94: /* SDRAM_ECCCFG */
523 case 0x98: /* SDRAM_ECCESR */
532 /* Avoid gcc warning */
540 static void dcr_write_sdram (void *opaque
, int dcrn
, uint32_t val
)
542 ppc4xx_sdram_t
*sdram
;
550 switch (sdram
->addr
) {
551 case 0x00: /* SDRAM_BESR0 */
552 sdram
->besr0
&= ~val
;
554 case 0x08: /* SDRAM_BESR1 */
555 sdram
->besr1
&= ~val
;
557 case 0x10: /* SDRAM_BEAR */
560 case 0x20: /* SDRAM_CFG */
562 if (!(sdram
->cfg
& 0x80000000) && (val
& 0x80000000)) {
564 printf("%s: enable SDRAM controller\n", __func__
);
566 /* validate all RAM mappings */
567 sdram_map_bcr(sdram
);
568 sdram
->status
&= ~0x80000000;
569 } else if ((sdram
->cfg
& 0x80000000) && !(val
& 0x80000000)) {
571 printf("%s: disable SDRAM controller\n", __func__
);
573 /* invalidate all RAM mappings */
574 sdram_unmap_bcr(sdram
);
575 sdram
->status
|= 0x80000000;
577 if (!(sdram
->cfg
& 0x40000000) && (val
& 0x40000000))
578 sdram
->status
|= 0x40000000;
579 else if ((sdram
->cfg
& 0x40000000) && !(val
& 0x40000000))
580 sdram
->status
&= ~0x40000000;
583 case 0x24: /* SDRAM_STATUS */
584 /* Read-only register */
586 case 0x30: /* SDRAM_RTR */
587 sdram
->rtr
= val
& 0x3FF80000;
589 case 0x34: /* SDRAM_PMIT */
590 sdram
->pmit
= (val
& 0xF8000000) | 0x07C00000;
592 case 0x40: /* SDRAM_B0CR */
593 sdram_set_bcr(sdram
, &sdram
->bcr
[0], val
, sdram
->cfg
& 0x80000000);
595 case 0x44: /* SDRAM_B1CR */
596 sdram_set_bcr(sdram
, &sdram
->bcr
[1], val
, sdram
->cfg
& 0x80000000);
598 case 0x48: /* SDRAM_B2CR */
599 sdram_set_bcr(sdram
, &sdram
->bcr
[2], val
, sdram
->cfg
& 0x80000000);
601 case 0x4C: /* SDRAM_B3CR */
602 sdram_set_bcr(sdram
, &sdram
->bcr
[3], val
, sdram
->cfg
& 0x80000000);
604 case 0x80: /* SDRAM_TR */
605 sdram
->tr
= val
& 0x018FC01F;
607 case 0x94: /* SDRAM_ECCCFG */
608 sdram
->ecccfg
= val
& 0x00F00000;
610 case 0x98: /* SDRAM_ECCESR */
612 if (sdram
->eccesr
== 0 && val
!= 0)
613 qemu_irq_raise(sdram
->irq
);
614 else if (sdram
->eccesr
!= 0 && val
== 0)
615 qemu_irq_lower(sdram
->irq
);
625 static void sdram_reset (void *opaque
)
627 ppc4xx_sdram_t
*sdram
;
630 sdram
->addr
= 0x00000000;
631 sdram
->bear
= 0x00000000;
632 sdram
->besr0
= 0x00000000; /* No error */
633 sdram
->besr1
= 0x00000000; /* No error */
634 sdram
->cfg
= 0x00000000;
635 sdram
->ecccfg
= 0x00000000; /* No ECC */
636 sdram
->eccesr
= 0x00000000; /* No error */
637 sdram
->pmit
= 0x07C00000;
638 sdram
->rtr
= 0x05F00000;
639 sdram
->tr
= 0x00854009;
640 /* We pre-initialize RAM banks */
641 sdram
->status
= 0x00000000;
642 sdram
->cfg
= 0x00800000;
645 void ppc4xx_sdram_init (CPUPPCState
*env
, qemu_irq irq
, int nbanks
,
646 MemoryRegion
*ram_memories
,
651 ppc4xx_sdram_t
*sdram
;
653 sdram
= g_malloc0(sizeof(ppc4xx_sdram_t
));
655 sdram
->nbanks
= nbanks
;
656 sdram
->ram_memories
= ram_memories
;
657 memset(sdram
->ram_bases
, 0, 4 * sizeof(hwaddr
));
658 memcpy(sdram
->ram_bases
, ram_bases
,
659 nbanks
* sizeof(hwaddr
));
660 memset(sdram
->ram_sizes
, 0, 4 * sizeof(hwaddr
));
661 memcpy(sdram
->ram_sizes
, ram_sizes
,
662 nbanks
* sizeof(hwaddr
));
663 qemu_register_reset(&sdram_reset
, sdram
);
664 ppc_dcr_register(env
, SDRAM0_CFGADDR
,
665 sdram
, &dcr_read_sdram
, &dcr_write_sdram
);
666 ppc_dcr_register(env
, SDRAM0_CFGDATA
,
667 sdram
, &dcr_read_sdram
, &dcr_write_sdram
);
669 sdram_map_bcr(sdram
);
672 /* Fill in consecutive SDRAM banks with 'ram_size' bytes of memory.
674 * sdram_bank_sizes[] must be 0-terminated.
676 * The 4xx SDRAM controller supports a small number of banks, and each bank
677 * must be one of a small set of sizes. The number of banks and the supported
678 * sizes varies by SoC. */
679 ram_addr_t
ppc4xx_sdram_adjust(ram_addr_t ram_size
, int nr_banks
,
680 MemoryRegion ram_memories
[],
683 const unsigned int sdram_bank_sizes
[])
685 MemoryRegion
*ram
= g_malloc0(sizeof(*ram
));
686 ram_addr_t size_left
= ram_size
;
688 unsigned int bank_size
;
692 for (i
= 0; i
< nr_banks
; i
++) {
693 for (j
= 0; sdram_bank_sizes
[j
] != 0; j
++) {
694 bank_size
= sdram_bank_sizes
[j
];
695 if (bank_size
<= size_left
) {
696 size_left
-= bank_size
;
700 /* No need to use the remaining banks. */
705 ram_size
-= size_left
;
707 error_report("Truncating memory to %" PRId64
" MiB to fit SDRAM"
708 " controller limits", ram_size
/ MiB
);
711 memory_region_allocate_system_memory(ram
, NULL
, "ppc4xx.sdram", ram_size
);
713 size_left
= ram_size
;
714 for (i
= 0; i
< nr_banks
&& size_left
; i
++) {
715 for (j
= 0; sdram_bank_sizes
[j
] != 0; j
++) {
716 bank_size
= sdram_bank_sizes
[j
];
718 if (bank_size
<= size_left
) {
720 snprintf(name
, sizeof(name
), "ppc4xx.sdram%d", i
);
721 memory_region_init_alias(&ram_memories
[i
], NULL
, name
, ram
,
724 ram_sizes
[i
] = bank_size
;
726 size_left
-= bank_size
;
735 /*****************************************************************************/
744 MAL0_TXEOBISR
= 0x186,
748 MAL0_RXEOBISR
= 0x192,
750 MAL0_TXCTP0R
= 0x1A0,
751 MAL0_RXCTP0R
= 0x1C0,
756 typedef struct ppc4xx_mal_t ppc4xx_mal_t
;
757 struct ppc4xx_mal_t
{
777 static void ppc4xx_mal_reset(void *opaque
)
782 mal
->cfg
= 0x0007C000;
783 mal
->esr
= 0x00000000;
784 mal
->ier
= 0x00000000;
785 mal
->rxcasr
= 0x00000000;
786 mal
->rxdeir
= 0x00000000;
787 mal
->rxeobisr
= 0x00000000;
788 mal
->txcasr
= 0x00000000;
789 mal
->txdeir
= 0x00000000;
790 mal
->txeobisr
= 0x00000000;
793 static uint32_t dcr_read_mal(void *opaque
, int dcrn
)
837 if (dcrn
>= MAL0_TXCTP0R
&& dcrn
< MAL0_TXCTP0R
+ mal
->txcnum
) {
838 ret
= mal
->txctpr
[dcrn
- MAL0_TXCTP0R
];
840 if (dcrn
>= MAL0_RXCTP0R
&& dcrn
< MAL0_RXCTP0R
+ mal
->rxcnum
) {
841 ret
= mal
->rxctpr
[dcrn
- MAL0_RXCTP0R
];
843 if (dcrn
>= MAL0_RCBS0
&& dcrn
< MAL0_RCBS0
+ mal
->rxcnum
) {
844 ret
= mal
->rcbs
[dcrn
- MAL0_RCBS0
];
850 static void dcr_write_mal(void *opaque
, int dcrn
, uint32_t val
)
857 if (val
& 0x80000000) {
858 ppc4xx_mal_reset(mal
);
860 mal
->cfg
= val
& 0x00FFC087;
867 mal
->ier
= val
& 0x0000001F;
870 mal
->txcasr
= val
& 0xF0000000;
873 mal
->txcarr
= val
& 0xF0000000;
877 mal
->txeobisr
&= ~val
;
884 mal
->rxcasr
= val
& 0xC0000000;
887 mal
->rxcarr
= val
& 0xC0000000;
891 mal
->rxeobisr
&= ~val
;
898 if (dcrn
>= MAL0_TXCTP0R
&& dcrn
< MAL0_TXCTP0R
+ mal
->txcnum
) {
899 mal
->txctpr
[dcrn
- MAL0_TXCTP0R
] = val
;
901 if (dcrn
>= MAL0_RXCTP0R
&& dcrn
< MAL0_RXCTP0R
+ mal
->rxcnum
) {
902 mal
->rxctpr
[dcrn
- MAL0_RXCTP0R
] = val
;
904 if (dcrn
>= MAL0_RCBS0
&& dcrn
< MAL0_RCBS0
+ mal
->rxcnum
) {
905 mal
->rcbs
[dcrn
- MAL0_RCBS0
] = val
& 0x000000FF;
909 void ppc4xx_mal_init(CPUPPCState
*env
, uint8_t txcnum
, uint8_t rxcnum
,
915 assert(txcnum
<= 32 && rxcnum
<= 32);
916 mal
= g_malloc0(sizeof(*mal
));
917 mal
->txcnum
= txcnum
;
918 mal
->rxcnum
= rxcnum
;
919 mal
->txctpr
= g_new0(uint32_t, txcnum
);
920 mal
->rxctpr
= g_new0(uint32_t, rxcnum
);
921 mal
->rcbs
= g_new0(uint32_t, rxcnum
);
922 for (i
= 0; i
< 4; i
++) {
923 mal
->irqs
[i
] = irqs
[i
];
925 qemu_register_reset(&ppc4xx_mal_reset
, mal
);
926 ppc_dcr_register(env
, MAL0_CFG
,
927 mal
, &dcr_read_mal
, &dcr_write_mal
);
928 ppc_dcr_register(env
, MAL0_ESR
,
929 mal
, &dcr_read_mal
, &dcr_write_mal
);
930 ppc_dcr_register(env
, MAL0_IER
,
931 mal
, &dcr_read_mal
, &dcr_write_mal
);
932 ppc_dcr_register(env
, MAL0_TXCASR
,
933 mal
, &dcr_read_mal
, &dcr_write_mal
);
934 ppc_dcr_register(env
, MAL0_TXCARR
,
935 mal
, &dcr_read_mal
, &dcr_write_mal
);
936 ppc_dcr_register(env
, MAL0_TXEOBISR
,
937 mal
, &dcr_read_mal
, &dcr_write_mal
);
938 ppc_dcr_register(env
, MAL0_TXDEIR
,
939 mal
, &dcr_read_mal
, &dcr_write_mal
);
940 ppc_dcr_register(env
, MAL0_RXCASR
,
941 mal
, &dcr_read_mal
, &dcr_write_mal
);
942 ppc_dcr_register(env
, MAL0_RXCARR
,
943 mal
, &dcr_read_mal
, &dcr_write_mal
);
944 ppc_dcr_register(env
, MAL0_RXEOBISR
,
945 mal
, &dcr_read_mal
, &dcr_write_mal
);
946 ppc_dcr_register(env
, MAL0_RXDEIR
,
947 mal
, &dcr_read_mal
, &dcr_write_mal
);
948 for (i
= 0; i
< txcnum
; i
++) {
949 ppc_dcr_register(env
, MAL0_TXCTP0R
+ i
,
950 mal
, &dcr_read_mal
, &dcr_write_mal
);
952 for (i
= 0; i
< rxcnum
; i
++) {
953 ppc_dcr_register(env
, MAL0_RXCTP0R
+ i
,
954 mal
, &dcr_read_mal
, &dcr_write_mal
);
956 for (i
= 0; i
< rxcnum
; i
++) {
957 ppc_dcr_register(env
, MAL0_RCBS0
+ i
,
958 mal
, &dcr_read_mal
, &dcr_write_mal
);