qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch V5 2/5] Implement i.MX31 Clock Control Module


From: Peter Chubb
Subject: Re: [Qemu-devel] [patch V5 2/5] Implement i.MX31 Clock Control Module
Date: Tue, 10 Apr 2012 11:24:33 +1000
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

>>>>> "Peter" == Peter Maydell <address@hidden> writes:

Peter> On 3 April 2012 02:55, Peter Chubb <address@hidden>
Peter> wrote:
> +
> +uint32_t imx_timer_frequency(DeviceState *s, IMXClk clock);
> +void imx_timer_create(const char * const name,
> +                      const target_phys_addr_t addr,
> +                      qemu_irq irq,
> +                      DeviceState *ccm);
> +

Peter> These function prototypes should be in the other patch, surely?

Yes. At least, the second one does.  Thanks, moved to the imx_timer.c patch.

>> +/* PDR0 */ +#define PDR0_MCU_PODF_SHIFT (0) +#define
>> PDR0_MCU_PODF_MASK (0x7) +#define PDR0_MAX_PODF_SHIFT (3) +#define
>> PDR0_MAX_PODF_MASK (0x7) +#define PDR0_IPG_PODF_SHIFT (6) +#define
>> PDR0_IPG_PODF_MASK (0x3) +#define PDR0_NFC_PODF_SHIFT (8) +#define
>> PDR0_NFC_PODF_MASK (7)

Peter> Some consistency about whether you're using 7 or 0x7 for masks
Peter> would be nice.

Done.

> +static void imx_ccm_reset(DeviceState *dev)
> +{
> +    IMXCCMState *s = container_of(dev, IMXCCMState, busdev.qdev);
> +
> +    s->cgr[0] = s->cgr[1] = s->cgr[2] = 0xffffffff;
> +    s->pmcr0 = 0x80209828;
> +    s->pdr1 = 0x49fcfe7f;
> +    s->spctl = PLL_PD(1) | PLL_MFD(4) | PLL_MFI(0xc) | PLL_MFN(1);
> +
> +    /*
> +     * Really should predicate this on arm_boot_info->is_linux
> +     * but I don't know how to do that.
> +     */
> +    if (1) {
> +        imx_ccm_uboot_reset(s);
> +    } else {
> +        imx_ccm_hw_reset(s);
> +    }
> +    update_clocks(s);
> +}
> +

Peter> Urgh. Device models need to act like the device. Setting up
Peter> devices the way u-boot happens to initialise them should be
Peter> done somewhere else, ie driven by our built in bootloader, if
Peter> we do it at all.

I'd like to be able to do
  arm-system-qemu -M kzm -nographic -kernel zImage
and have it work the same as if it'd been booted on the real
hardware.

For now I've removed the u-boot stuff.

Is there a sane way to add to the built-in bootloader?  

--
Dr Peter Chubb                                  peter.chubb AT nicta.com.au
http://www.ssrg.nicta.com.au          Software Systems Research Group/NICTA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]