static void pxa2xx_descriptor_load(struct pxa2xx_lcdc_s *s)

{

    struct pxa_frame_descriptor_s desc;

    target_phys_addr_t descptr;

    int i;



    for (i = 0; i < PXA_LCDDMA_CHANS; i ++) {

        s->dma_ch[i].source = 0;



        if (!s->dma_ch[i].up)

            continue;



        if (s->dma_ch[i].branch & FBR_BRA) {

            descptr = s->dma_ch[i].branch & FBR_SRCADDR;

            if (s->dma_ch[i].branch & FBR_BINT)

                pxa2xx_dma_bs_set(s, i);

            s->dma_ch[i].branch &= ~FBR_BRA;

        } else

            descptr = s->dma_ch[i].descriptor;



        if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +

                    sizeof(desc) <= PXA2XX_SDRAM_BASE + phys_ram_size))

            continue;



        cpu_physical_memory_read(descptr, (void *)&desc, sizeof(desc));

        s->dma_ch[i].descriptor = tswap32(desc.fdaddr);

        s->dma_ch[i].source = tswap32(desc.fsaddr);

        s->dma_ch[i].id = tswap32(desc.fidr);

        s->dma_ch[i].command = tswap32(desc.ldcmd);

    }

}

static void pxa2xx_descriptor_load(struct pxa2xx_lcdc_s *s)

{

    struct pxa_frame_descriptor_s desc;

    target_phys_addr_t descptr;

    int i;



    for (i = 0; i < PXA_LCDDMA_CHANS; i ++) {

        s->dma_ch[i].source = 0;



        if (!s->dma_ch[i].up)

            continue;



        if (s->dma_ch[i].branch & FBR_BRA) {

            descptr = s->dma_ch[i].branch & FBR_SRCADDR;

            if (s->dma_ch[i].branch & FBR_BINT)

                pxa2xx_dma_bs_set(s, i);

            s->dma_ch[i].branch &= ~FBR_BRA;

        } else

            descptr = s->dma_ch[i].descriptor;



        if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +

                    sizeof(desc) <= PXA2XX_SDRAM_BASE + phys_ram_size))

            continue;



        cpu_physical_memory_read(descptr, (void *)&desc, sizeof(desc));

        s->dma_ch[i].descriptor = tswap32(desc.fdaddr);

        s->dma_ch[i].source = tswap32(desc.fsaddr);

        s->dma_ch[i].id = tswap32(desc.fidr);

        s->dma_ch[i].command = tswap32(desc.ldcmd);

    }

}

static void FUNC_0(struct pxa2xx_lcdc_s *VAR_0)

{

    struct pxa_frame_descriptor_s VAR_1;

    target_phys_addr_t descptr;

    int VAR_2;



    for (VAR_2 = 0; VAR_2 < PXA_LCDDMA_CHANS; VAR_2 ++) {

        VAR_0->dma_ch[VAR_2].source = 0;



        if (!VAR_0->dma_ch[VAR_2].up)

            continue;



        if (VAR_0->dma_ch[VAR_2].branch & FBR_BRA) {

            descptr = VAR_0->dma_ch[VAR_2].branch & FBR_SRCADDR;

            if (VAR_0->dma_ch[VAR_2].branch & FBR_BINT)

                pxa2xx_dma_bs_set(VAR_0, VAR_2);

            VAR_0->dma_ch[VAR_2].branch &= ~FBR_BRA;

        } else

            descptr = VAR_0->dma_ch[VAR_2].descriptor;



        if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +

                    sizeof(VAR_1) <= PXA2XX_SDRAM_BASE + phys_ram_size))

            continue;



        cpu_physical_memory_read(descptr, (void *)&VAR_1, sizeof(VAR_1));

        VAR_0->dma_ch[VAR_2].descriptor = tswap32(VAR_1.fdaddr);

        VAR_0->dma_ch[VAR_2].source = tswap32(VAR_1.fsaddr);

        VAR_0->dma_ch[VAR_2].id = tswap32(VAR_1.fidr);

        VAR_0->dma_ch[VAR_2].command = tswap32(VAR_1.ldcmd);

    }

}

static void FUNC_0(struct pxa2xx_lcdc_s *VAR_0)
{ struct pxa_frame_descriptor_s VAR_1; target_phys_addr_t descptr; int VAR_2; for (VAR_2 = 0; VAR_2 < PXA_LCDDMA_CHANS; VAR_2 ++) { VAR_0->dma_ch[VAR_2].source = 0; if (!VAR_0->dma_ch[VAR_2].up)
continue; if (VAR_0->dma_ch[VAR_2].branch & FBR_BRA) { descptr = VAR_0->dma_ch[VAR_2].branch & FBR_SRCADDR; if (VAR_0->dma_ch[VAR_2].branch & FBR_BINT)
pxa2xx_dma_bs_set(VAR_0, VAR_2); VAR_0->dma_ch[VAR_2].branch &= ~FBR_BRA; } else descptr = VAR_0->dma_ch[VAR_2].descriptor; if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +
sizeof(VAR_1) <= PXA2XX_SDRAM_BASE + phys_ram_size))
continue; cpu_physical_memory_read(descptr, (void *)&VAR_1, sizeof(VAR_1)); VAR_0->dma_ch[VAR_2].descriptor = tswap32(VAR_1.fdaddr); VAR_0->dma_ch[VAR_2].source = tswap32(VAR_1.fsaddr); VAR_0->dma_ch[VAR_2].id = tswap32(VAR_1.fidr); VAR_0->dma_ch[VAR_2].command = tswap32(VAR_1.ldcmd); } }