xref: /qemu/hw/misc/imx25_ccm.c (revision d552f675fb313eb020c384c03307ecfb83dce1ad)
192eccc6eSJean-Christophe Dubois /*
292eccc6eSJean-Christophe Dubois  * IMX25 Clock Control Module
392eccc6eSJean-Christophe Dubois  *
492eccc6eSJean-Christophe Dubois  * Copyright (C) 2012 NICTA
592eccc6eSJean-Christophe Dubois  * Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
692eccc6eSJean-Christophe Dubois  *
792eccc6eSJean-Christophe Dubois  * This work is licensed under the terms of the GNU GPL, version 2 or later.
892eccc6eSJean-Christophe Dubois  * See the COPYING file in the top-level directory.
992eccc6eSJean-Christophe Dubois  *
1092eccc6eSJean-Christophe Dubois  * To get the timer frequencies right, we need to emulate at least part of
1192eccc6eSJean-Christophe Dubois  * the CCM.
1292eccc6eSJean-Christophe Dubois  */
1392eccc6eSJean-Christophe Dubois 
148ef94f0bSPeter Maydell #include "qemu/osdep.h"
1592eccc6eSJean-Christophe Dubois #include "hw/misc/imx25_ccm.h"
1692eccc6eSJean-Christophe Dubois 
1792eccc6eSJean-Christophe Dubois #ifndef DEBUG_IMX25_CCM
1892eccc6eSJean-Christophe Dubois #define DEBUG_IMX25_CCM 0
1992eccc6eSJean-Christophe Dubois #endif
2092eccc6eSJean-Christophe Dubois 
2192eccc6eSJean-Christophe Dubois #define DPRINTF(fmt, args...) \
2292eccc6eSJean-Christophe Dubois     do { \
2392eccc6eSJean-Christophe Dubois         if (DEBUG_IMX25_CCM) { \
2492eccc6eSJean-Christophe Dubois             fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX25_CCM, \
2592eccc6eSJean-Christophe Dubois                                              __func__, ##args); \
2692eccc6eSJean-Christophe Dubois         } \
2792eccc6eSJean-Christophe Dubois     } while (0)
2892eccc6eSJean-Christophe Dubois 
2992eccc6eSJean-Christophe Dubois static char const *imx25_ccm_reg_name(uint32_t reg)
3092eccc6eSJean-Christophe Dubois {
3192eccc6eSJean-Christophe Dubois     static char unknown[20];
3292eccc6eSJean-Christophe Dubois 
3392eccc6eSJean-Christophe Dubois     switch (reg) {
3492eccc6eSJean-Christophe Dubois     case IMX25_CCM_MPCTL_REG:
3592eccc6eSJean-Christophe Dubois         return "mpctl";
3692eccc6eSJean-Christophe Dubois     case IMX25_CCM_UPCTL_REG:
3792eccc6eSJean-Christophe Dubois         return "upctl";
3892eccc6eSJean-Christophe Dubois     case IMX25_CCM_CCTL_REG:
3992eccc6eSJean-Christophe Dubois         return "cctl";
4092eccc6eSJean-Christophe Dubois     case IMX25_CCM_CGCR0_REG:
4192eccc6eSJean-Christophe Dubois         return "cgcr0";
4292eccc6eSJean-Christophe Dubois     case IMX25_CCM_CGCR1_REG:
4392eccc6eSJean-Christophe Dubois         return "cgcr1";
4492eccc6eSJean-Christophe Dubois     case IMX25_CCM_CGCR2_REG:
4592eccc6eSJean-Christophe Dubois         return "cgcr2";
4692eccc6eSJean-Christophe Dubois     case IMX25_CCM_PCDR0_REG:
4792eccc6eSJean-Christophe Dubois         return "pcdr0";
4892eccc6eSJean-Christophe Dubois     case IMX25_CCM_PCDR1_REG:
4992eccc6eSJean-Christophe Dubois         return "pcdr1";
5092eccc6eSJean-Christophe Dubois     case IMX25_CCM_PCDR2_REG:
5192eccc6eSJean-Christophe Dubois         return "pcdr2";
5292eccc6eSJean-Christophe Dubois     case IMX25_CCM_PCDR3_REG:
5392eccc6eSJean-Christophe Dubois         return "pcdr3";
5492eccc6eSJean-Christophe Dubois     case IMX25_CCM_RCSR_REG:
5592eccc6eSJean-Christophe Dubois         return "rcsr";
5692eccc6eSJean-Christophe Dubois     case IMX25_CCM_CRDR_REG:
5792eccc6eSJean-Christophe Dubois         return "crdr";
5892eccc6eSJean-Christophe Dubois     case IMX25_CCM_DCVR0_REG:
5992eccc6eSJean-Christophe Dubois         return "dcvr0";
6092eccc6eSJean-Christophe Dubois     case IMX25_CCM_DCVR1_REG:
6192eccc6eSJean-Christophe Dubois         return "dcvr1";
6292eccc6eSJean-Christophe Dubois     case IMX25_CCM_DCVR2_REG:
6392eccc6eSJean-Christophe Dubois         return "dcvr2";
6492eccc6eSJean-Christophe Dubois     case IMX25_CCM_DCVR3_REG:
6592eccc6eSJean-Christophe Dubois         return "dcvr3";
6692eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTR0_REG:
6792eccc6eSJean-Christophe Dubois         return "ltr0";
6892eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTR1_REG:
6992eccc6eSJean-Christophe Dubois         return "ltr1";
7092eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTR2_REG:
7192eccc6eSJean-Christophe Dubois         return "ltr2";
7292eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTR3_REG:
7392eccc6eSJean-Christophe Dubois         return "ltr3";
7492eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTBR0_REG:
7592eccc6eSJean-Christophe Dubois         return "ltbr0";
7692eccc6eSJean-Christophe Dubois     case IMX25_CCM_LTBR1_REG:
7792eccc6eSJean-Christophe Dubois         return "ltbr1";
7892eccc6eSJean-Christophe Dubois     case IMX25_CCM_PMCR0_REG:
7992eccc6eSJean-Christophe Dubois         return "pmcr0";
8092eccc6eSJean-Christophe Dubois     case IMX25_CCM_PMCR1_REG:
8192eccc6eSJean-Christophe Dubois         return "pmcr1";
8292eccc6eSJean-Christophe Dubois     case IMX25_CCM_PMCR2_REG:
8392eccc6eSJean-Christophe Dubois         return "pmcr2";
8492eccc6eSJean-Christophe Dubois     case IMX25_CCM_MCR_REG:
8592eccc6eSJean-Christophe Dubois         return "mcr";
8692eccc6eSJean-Christophe Dubois     case IMX25_CCM_LPIMR0_REG:
8792eccc6eSJean-Christophe Dubois         return "lpimr0";
8892eccc6eSJean-Christophe Dubois     case IMX25_CCM_LPIMR1_REG:
8992eccc6eSJean-Christophe Dubois         return "lpimr1";
9092eccc6eSJean-Christophe Dubois     default:
9192eccc6eSJean-Christophe Dubois         sprintf(unknown, "[%d ?]", reg);
9292eccc6eSJean-Christophe Dubois         return unknown;
9392eccc6eSJean-Christophe Dubois     }
9492eccc6eSJean-Christophe Dubois }
9592eccc6eSJean-Christophe Dubois #define CKIH_FREQ 24000000 /* 24MHz crystal input */
9692eccc6eSJean-Christophe Dubois 
9792eccc6eSJean-Christophe Dubois static const VMStateDescription vmstate_imx25_ccm = {
9892eccc6eSJean-Christophe Dubois     .name = TYPE_IMX25_CCM,
9992eccc6eSJean-Christophe Dubois     .version_id = 1,
10092eccc6eSJean-Christophe Dubois     .minimum_version_id = 1,
10192eccc6eSJean-Christophe Dubois     .fields = (VMStateField[]) {
10292eccc6eSJean-Christophe Dubois         VMSTATE_UINT32_ARRAY(reg, IMX25CCMState, IMX25_CCM_MAX_REG),
10392eccc6eSJean-Christophe Dubois         VMSTATE_END_OF_LIST()
10492eccc6eSJean-Christophe Dubois     },
10592eccc6eSJean-Christophe Dubois };
10692eccc6eSJean-Christophe Dubois 
10792eccc6eSJean-Christophe Dubois static uint32_t imx25_ccm_get_mpll_clk(IMXCCMState *dev)
10892eccc6eSJean-Christophe Dubois {
10992eccc6eSJean-Christophe Dubois     uint32_t freq;
11092eccc6eSJean-Christophe Dubois     IMX25CCMState *s = IMX25_CCM(dev);
11192eccc6eSJean-Christophe Dubois 
11292eccc6eSJean-Christophe Dubois     if (EXTRACT(s->reg[IMX25_CCM_CCTL_REG], MPLL_BYPASS)) {
11392eccc6eSJean-Christophe Dubois         freq = CKIH_FREQ;
11492eccc6eSJean-Christophe Dubois     } else {
11592eccc6eSJean-Christophe Dubois         freq = imx_ccm_calc_pll(s->reg[IMX25_CCM_MPCTL_REG], CKIH_FREQ);
11692eccc6eSJean-Christophe Dubois     }
11792eccc6eSJean-Christophe Dubois 
11892eccc6eSJean-Christophe Dubois     DPRINTF("freq = %d\n", freq);
11992eccc6eSJean-Christophe Dubois 
12092eccc6eSJean-Christophe Dubois     return freq;
12192eccc6eSJean-Christophe Dubois }
12292eccc6eSJean-Christophe Dubois 
12392eccc6eSJean-Christophe Dubois static uint32_t imx25_ccm_get_mcu_clk(IMXCCMState *dev)
12492eccc6eSJean-Christophe Dubois {
12592eccc6eSJean-Christophe Dubois     uint32_t freq;
12692eccc6eSJean-Christophe Dubois     IMX25CCMState *s = IMX25_CCM(dev);
12792eccc6eSJean-Christophe Dubois 
12892eccc6eSJean-Christophe Dubois     freq = imx25_ccm_get_mpll_clk(dev);
12992eccc6eSJean-Christophe Dubois 
13092eccc6eSJean-Christophe Dubois     if (EXTRACT(s->reg[IMX25_CCM_CCTL_REG], ARM_SRC)) {
13192eccc6eSJean-Christophe Dubois         freq = (freq * 3 / 4);
13292eccc6eSJean-Christophe Dubois     }
13392eccc6eSJean-Christophe Dubois 
13492eccc6eSJean-Christophe Dubois     freq = freq / (1 + EXTRACT(s->reg[IMX25_CCM_CCTL_REG], ARM_CLK_DIV));
13592eccc6eSJean-Christophe Dubois 
13692eccc6eSJean-Christophe Dubois     DPRINTF("freq = %d\n", freq);
13792eccc6eSJean-Christophe Dubois 
13892eccc6eSJean-Christophe Dubois     return freq;
13992eccc6eSJean-Christophe Dubois }
14092eccc6eSJean-Christophe Dubois 
14192eccc6eSJean-Christophe Dubois static uint32_t imx25_ccm_get_ahb_clk(IMXCCMState *dev)
14292eccc6eSJean-Christophe Dubois {
14392eccc6eSJean-Christophe Dubois     uint32_t freq;
14492eccc6eSJean-Christophe Dubois     IMX25CCMState *s = IMX25_CCM(dev);
14592eccc6eSJean-Christophe Dubois 
14692eccc6eSJean-Christophe Dubois     freq = imx25_ccm_get_mcu_clk(dev)
14792eccc6eSJean-Christophe Dubois            / (1 + EXTRACT(s->reg[IMX25_CCM_CCTL_REG], AHB_CLK_DIV));
14892eccc6eSJean-Christophe Dubois 
14992eccc6eSJean-Christophe Dubois     DPRINTF("freq = %d\n", freq);
15092eccc6eSJean-Christophe Dubois 
15192eccc6eSJean-Christophe Dubois     return freq;
15292eccc6eSJean-Christophe Dubois }
15392eccc6eSJean-Christophe Dubois 
15492eccc6eSJean-Christophe Dubois static uint32_t imx25_ccm_get_ipg_clk(IMXCCMState *dev)
15592eccc6eSJean-Christophe Dubois {
15692eccc6eSJean-Christophe Dubois     uint32_t freq;
15792eccc6eSJean-Christophe Dubois 
15892eccc6eSJean-Christophe Dubois     freq = imx25_ccm_get_ahb_clk(dev) / 2;
15992eccc6eSJean-Christophe Dubois 
16092eccc6eSJean-Christophe Dubois     DPRINTF("freq = %d\n", freq);
16192eccc6eSJean-Christophe Dubois 
16292eccc6eSJean-Christophe Dubois     return freq;
16392eccc6eSJean-Christophe Dubois }
16492eccc6eSJean-Christophe Dubois 
16592eccc6eSJean-Christophe Dubois static uint32_t imx25_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)
16692eccc6eSJean-Christophe Dubois {
16792eccc6eSJean-Christophe Dubois     uint32_t freq = 0;
16892eccc6eSJean-Christophe Dubois     DPRINTF("Clock = %d)\n", clock);
16992eccc6eSJean-Christophe Dubois 
17092eccc6eSJean-Christophe Dubois     switch (clock) {
171c91a5883SJean-Christophe Dubois     case CLK_NONE:
17292eccc6eSJean-Christophe Dubois         break;
17392eccc6eSJean-Christophe Dubois     case CLK_IPG:
174*d552f675SJean-Christophe Dubois     case CLK_IPG_HIGH:
17592eccc6eSJean-Christophe Dubois         freq = imx25_ccm_get_ipg_clk(dev);
17692eccc6eSJean-Christophe Dubois         break;
17792eccc6eSJean-Christophe Dubois     case CLK_32k:
17892eccc6eSJean-Christophe Dubois         freq = CKIL_FREQ;
17992eccc6eSJean-Christophe Dubois         break;
18092eccc6eSJean-Christophe Dubois     default:
18192eccc6eSJean-Christophe Dubois         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: unsupported clock %d\n",
18292eccc6eSJean-Christophe Dubois                       TYPE_IMX25_CCM, __func__, clock);
18392eccc6eSJean-Christophe Dubois         break;
18492eccc6eSJean-Christophe Dubois     }
18592eccc6eSJean-Christophe Dubois 
18692eccc6eSJean-Christophe Dubois     DPRINTF("Clock = %d) = %d\n", clock, freq);
18792eccc6eSJean-Christophe Dubois 
18892eccc6eSJean-Christophe Dubois     return freq;
18992eccc6eSJean-Christophe Dubois }
19092eccc6eSJean-Christophe Dubois 
19192eccc6eSJean-Christophe Dubois static void imx25_ccm_reset(DeviceState *dev)
19292eccc6eSJean-Christophe Dubois {
19392eccc6eSJean-Christophe Dubois     IMX25CCMState *s = IMX25_CCM(dev);
19492eccc6eSJean-Christophe Dubois 
19592eccc6eSJean-Christophe Dubois     DPRINTF("\n");
19692eccc6eSJean-Christophe Dubois 
19792eccc6eSJean-Christophe Dubois     memset(s->reg, 0, IMX25_CCM_MAX_REG * sizeof(uint32_t));
19892eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_MPCTL_REG] = 0x800b2c01;
19992eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_UPCTL_REG] = 0x84042800;
20092eccc6eSJean-Christophe Dubois     /*
20192eccc6eSJean-Christophe Dubois      * The value below gives:
20292eccc6eSJean-Christophe Dubois      * CPU = 133 MHz, AHB = 66,5 MHz, IPG = 33 MHz.
20392eccc6eSJean-Christophe Dubois      */
20492eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_CCTL_REG]  = 0xd0030000;
20592eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_CGCR0_REG] = 0x028A0100;
20692eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_CGCR1_REG] = 0x04008100;
20792eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_CGCR2_REG] = 0x00000438;
20892eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PCDR0_REG] = 0x01010101;
20992eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PCDR1_REG] = 0x01010101;
21092eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PCDR2_REG] = 0x01010101;
21192eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PCDR3_REG] = 0x01010101;
21292eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PMCR0_REG] = 0x00A00000;
21392eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PMCR1_REG] = 0x0000A030;
21492eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_PMCR2_REG] = 0x0000A030;
21592eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_MCR_REG]   = 0x43000000;
21692eccc6eSJean-Christophe Dubois 
21792eccc6eSJean-Christophe Dubois     /*
21892eccc6eSJean-Christophe Dubois      * default boot will change the reset values to allow:
21992eccc6eSJean-Christophe Dubois      * CPU = 399 MHz, AHB = 133 MHz, IPG = 66,5 MHz.
22092eccc6eSJean-Christophe Dubois      * For some reason, this doesn't work. With the value below, linux
22192eccc6eSJean-Christophe Dubois      * detects a 88 MHz IPG CLK instead of 66,5 MHz.
22292eccc6eSJean-Christophe Dubois     s->reg[IMX25_CCM_CCTL_REG]  = 0x20032000;
22392eccc6eSJean-Christophe Dubois      */
22492eccc6eSJean-Christophe Dubois }
22592eccc6eSJean-Christophe Dubois 
22692eccc6eSJean-Christophe Dubois static uint64_t imx25_ccm_read(void *opaque, hwaddr offset, unsigned size)
22792eccc6eSJean-Christophe Dubois {
2283a87d009SPeter Maydell     uint32_t value = 0;
22992eccc6eSJean-Christophe Dubois     IMX25CCMState *s = (IMX25CCMState *)opaque;
23092eccc6eSJean-Christophe Dubois 
23192eccc6eSJean-Christophe Dubois     if (offset < 0x70) {
23292eccc6eSJean-Christophe Dubois         value = s->reg[offset >> 2];
23392eccc6eSJean-Christophe Dubois     } else {
23492eccc6eSJean-Christophe Dubois         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
23592eccc6eSJean-Christophe Dubois                       HWADDR_PRIx "\n", TYPE_IMX25_CCM, __func__, offset);
23692eccc6eSJean-Christophe Dubois     }
23792eccc6eSJean-Christophe Dubois 
23892eccc6eSJean-Christophe Dubois     DPRINTF("reg[%s] => 0x%" PRIx32 "\n", imx25_ccm_reg_name(offset >> 2),
23992eccc6eSJean-Christophe Dubois             value);
24092eccc6eSJean-Christophe Dubois 
24192eccc6eSJean-Christophe Dubois     return value;
24292eccc6eSJean-Christophe Dubois }
24392eccc6eSJean-Christophe Dubois 
24492eccc6eSJean-Christophe Dubois static void imx25_ccm_write(void *opaque, hwaddr offset, uint64_t value,
24592eccc6eSJean-Christophe Dubois                             unsigned size)
24692eccc6eSJean-Christophe Dubois {
24792eccc6eSJean-Christophe Dubois     IMX25CCMState *s = (IMX25CCMState *)opaque;
24892eccc6eSJean-Christophe Dubois 
24992eccc6eSJean-Christophe Dubois     DPRINTF("reg[%s] <= 0x%" PRIx32 "\n", imx25_ccm_reg_name(offset >> 2),
25092eccc6eSJean-Christophe Dubois             (uint32_t)value);
25192eccc6eSJean-Christophe Dubois 
25292eccc6eSJean-Christophe Dubois     if (offset < 0x70) {
25392eccc6eSJean-Christophe Dubois         /*
25492eccc6eSJean-Christophe Dubois          * We will do a better implementation later. In particular some bits
25592eccc6eSJean-Christophe Dubois          * cannot be written to.
25692eccc6eSJean-Christophe Dubois          */
25792eccc6eSJean-Christophe Dubois         s->reg[offset >> 2] = value;
25892eccc6eSJean-Christophe Dubois     } else {
25992eccc6eSJean-Christophe Dubois         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
26092eccc6eSJean-Christophe Dubois                       HWADDR_PRIx "\n", TYPE_IMX25_CCM, __func__, offset);
26192eccc6eSJean-Christophe Dubois     }
26292eccc6eSJean-Christophe Dubois }
26392eccc6eSJean-Christophe Dubois 
26492eccc6eSJean-Christophe Dubois static const struct MemoryRegionOps imx25_ccm_ops = {
26592eccc6eSJean-Christophe Dubois     .read = imx25_ccm_read,
26692eccc6eSJean-Christophe Dubois     .write = imx25_ccm_write,
26792eccc6eSJean-Christophe Dubois     .endianness = DEVICE_NATIVE_ENDIAN,
26892eccc6eSJean-Christophe Dubois     .valid = {
26992eccc6eSJean-Christophe Dubois         /*
27092eccc6eSJean-Christophe Dubois          * Our device would not work correctly if the guest was doing
27192eccc6eSJean-Christophe Dubois          * unaligned access. This might not be a limitation on the real
27292eccc6eSJean-Christophe Dubois          * device but in practice there is no reason for a guest to access
27392eccc6eSJean-Christophe Dubois          * this device unaligned.
27492eccc6eSJean-Christophe Dubois          */
27592eccc6eSJean-Christophe Dubois         .min_access_size = 4,
27692eccc6eSJean-Christophe Dubois         .max_access_size = 4,
27792eccc6eSJean-Christophe Dubois         .unaligned = false,
27892eccc6eSJean-Christophe Dubois     },
27992eccc6eSJean-Christophe Dubois };
28092eccc6eSJean-Christophe Dubois 
28192eccc6eSJean-Christophe Dubois static void imx25_ccm_init(Object *obj)
28292eccc6eSJean-Christophe Dubois {
28392eccc6eSJean-Christophe Dubois     DeviceState *dev = DEVICE(obj);
28492eccc6eSJean-Christophe Dubois     SysBusDevice *sd = SYS_BUS_DEVICE(obj);
28592eccc6eSJean-Christophe Dubois     IMX25CCMState *s = IMX25_CCM(obj);
28692eccc6eSJean-Christophe Dubois 
28792eccc6eSJean-Christophe Dubois     memory_region_init_io(&s->iomem, OBJECT(dev), &imx25_ccm_ops, s,
28892eccc6eSJean-Christophe Dubois                           TYPE_IMX25_CCM, 0x1000);
28992eccc6eSJean-Christophe Dubois     sysbus_init_mmio(sd, &s->iomem);
29092eccc6eSJean-Christophe Dubois }
29192eccc6eSJean-Christophe Dubois 
29292eccc6eSJean-Christophe Dubois static void imx25_ccm_class_init(ObjectClass *klass, void *data)
29392eccc6eSJean-Christophe Dubois {
29492eccc6eSJean-Christophe Dubois     DeviceClass *dc = DEVICE_CLASS(klass);
29592eccc6eSJean-Christophe Dubois     IMXCCMClass *ccm = IMX_CCM_CLASS(klass);
29692eccc6eSJean-Christophe Dubois 
29792eccc6eSJean-Christophe Dubois     dc->reset = imx25_ccm_reset;
29892eccc6eSJean-Christophe Dubois     dc->vmsd = &vmstate_imx25_ccm;
29992eccc6eSJean-Christophe Dubois     dc->desc = "i.MX25 Clock Control Module";
30092eccc6eSJean-Christophe Dubois 
30192eccc6eSJean-Christophe Dubois     ccm->get_clock_frequency = imx25_ccm_get_clock_frequency;
30292eccc6eSJean-Christophe Dubois }
30392eccc6eSJean-Christophe Dubois 
30492eccc6eSJean-Christophe Dubois static const TypeInfo imx25_ccm_info = {
30592eccc6eSJean-Christophe Dubois     .name          = TYPE_IMX25_CCM,
30692eccc6eSJean-Christophe Dubois     .parent        = TYPE_IMX_CCM,
30792eccc6eSJean-Christophe Dubois     .instance_size = sizeof(IMX25CCMState),
30892eccc6eSJean-Christophe Dubois     .instance_init = imx25_ccm_init,
30992eccc6eSJean-Christophe Dubois     .class_init    = imx25_ccm_class_init,
31092eccc6eSJean-Christophe Dubois };
31192eccc6eSJean-Christophe Dubois 
31292eccc6eSJean-Christophe Dubois static void imx25_ccm_register_types(void)
31392eccc6eSJean-Christophe Dubois {
31492eccc6eSJean-Christophe Dubois     type_register_static(&imx25_ccm_info);
31592eccc6eSJean-Christophe Dubois }
31692eccc6eSJean-Christophe Dubois 
31792eccc6eSJean-Christophe Dubois type_init(imx25_ccm_register_types)
318