2 * Copyright (c) 2018, Impinj, Inc.
4 * i.MX7 SoC definitions
6 * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
8 * Based on hw/arm/fsl-imx6.c
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #include "qemu/osdep.h"
22 #include "qapi/error.h"
23 #include "hw/arm/fsl-imx7.h"
24 #include "hw/misc/unimp.h"
25 #include "hw/boards.h"
26 #include "sysemu/sysemu.h"
27 #include "qemu/error-report.h"
28 #include "qemu/module.h"
32 static void fsl_imx7_init(Object
*obj
)
34 MachineState
*ms
= MACHINE(qdev_get_machine());
35 FslIMX7State
*s
= FSL_IMX7(obj
);
42 for (i
= 0; i
< MIN(ms
->smp
.cpus
, FSL_IMX7_NUM_CPUS
); i
++) {
43 snprintf(name
, NAME_SIZE
, "cpu%d", i
);
44 object_initialize_child(obj
, name
, &s
->cpu
[i
],
45 ARM_CPU_TYPE_NAME("cortex-a7"));
51 object_initialize_child(obj
, "a7mpcore", &s
->a7mpcore
,
57 for (i
= 0; i
< FSL_IMX7_NUM_GPIOS
; i
++) {
58 snprintf(name
, NAME_SIZE
, "gpio%d", i
);
59 object_initialize_child(obj
, name
, &s
->gpio
[i
], TYPE_IMX_GPIO
);
65 for (i
= 0; i
< FSL_IMX7_NUM_GPTS
; i
++) {
66 snprintf(name
, NAME_SIZE
, "gpt%d", i
);
67 object_initialize_child(obj
, name
, &s
->gpt
[i
], TYPE_IMX7_GPT
);
73 object_initialize_child(obj
, "ccm", &s
->ccm
, TYPE_IMX7_CCM
);
78 object_initialize_child(obj
, "analog", &s
->analog
, TYPE_IMX7_ANALOG
);
83 object_initialize_child(obj
, "gpcv2", &s
->gpcv2
, TYPE_IMX_GPCV2
);
88 object_initialize_child(obj
, "src", &s
->src
, TYPE_IMX7_SRC
);
93 for (i
= 0; i
< FSL_IMX7_NUM_ECSPIS
; i
++) {
94 snprintf(name
, NAME_SIZE
, "spi%d", i
+ 1);
95 object_initialize_child(obj
, name
, &s
->spi
[i
], TYPE_IMX_SPI
);
101 for (i
= 0; i
< FSL_IMX7_NUM_I2CS
; i
++) {
102 snprintf(name
, NAME_SIZE
, "i2c%d", i
+ 1);
103 object_initialize_child(obj
, name
, &s
->i2c
[i
], TYPE_IMX_I2C
);
109 for (i
= 0; i
< FSL_IMX7_NUM_UARTS
; i
++) {
110 snprintf(name
, NAME_SIZE
, "uart%d", i
);
111 object_initialize_child(obj
, name
, &s
->uart
[i
], TYPE_IMX_SERIAL
);
117 for (i
= 0; i
< FSL_IMX7_NUM_ETHS
; i
++) {
118 snprintf(name
, NAME_SIZE
, "eth%d", i
);
119 object_initialize_child(obj
, name
, &s
->eth
[i
], TYPE_IMX_ENET
);
125 for (i
= 0; i
< FSL_IMX7_NUM_USDHCS
; i
++) {
126 snprintf(name
, NAME_SIZE
, "usdhc%d", i
);
127 object_initialize_child(obj
, name
, &s
->usdhc
[i
], TYPE_IMX_USDHC
);
133 object_initialize_child(obj
, "snvs", &s
->snvs
, TYPE_IMX7_SNVS
);
138 for (i
= 0; i
< FSL_IMX7_NUM_WDTS
; i
++) {
139 snprintf(name
, NAME_SIZE
, "wdt%d", i
);
140 object_initialize_child(obj
, name
, &s
->wdt
[i
], TYPE_IMX2_WDT
);
146 object_initialize_child(obj
, "gpr", &s
->gpr
, TYPE_IMX7_GPR
);
151 object_initialize_child(obj
, "pcie", &s
->pcie
, TYPE_DESIGNWARE_PCIE_HOST
);
156 for (i
= 0; i
< FSL_IMX7_NUM_USBS
; i
++) {
157 snprintf(name
, NAME_SIZE
, "usb%d", i
);
158 object_initialize_child(obj
, name
, &s
->usb
[i
], TYPE_CHIPIDEA
);
162 static void fsl_imx7_realize(DeviceState
*dev
, Error
**errp
)
164 MachineState
*ms
= MACHINE(qdev_get_machine());
165 FslIMX7State
*s
= FSL_IMX7(dev
);
169 char name
[NAME_SIZE
];
170 unsigned int smp_cpus
= ms
->smp
.cpus
;
172 if (smp_cpus
> FSL_IMX7_NUM_CPUS
) {
173 error_setg(errp
, "%s: Only %d CPUs are supported (%d requested)",
174 TYPE_FSL_IMX7
, FSL_IMX7_NUM_CPUS
, smp_cpus
);
181 for (i
= 0; i
< smp_cpus
; i
++) {
182 o
= OBJECT(&s
->cpu
[i
]);
184 /* On uniprocessor, the CBAR is set to 0 */
186 object_property_set_int(o
, "reset-cbar", FSL_IMX7_A7MPCORE_ADDR
,
192 * Secondary CPUs start in powered-down state (and can be
193 * powered up via the SRC system reset controller)
195 object_property_set_bool(o
, "start-powered-off", true,
199 qdev_realize(DEVICE(o
), NULL
, &error_abort
);
205 object_property_set_int(OBJECT(&s
->a7mpcore
), "num-cpu", smp_cpus
,
207 object_property_set_int(OBJECT(&s
->a7mpcore
), "num-irq",
208 FSL_IMX7_MAX_IRQ
+ GIC_INTERNAL
, &error_abort
);
210 sysbus_realize(SYS_BUS_DEVICE(&s
->a7mpcore
), &error_abort
);
211 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->a7mpcore
), 0, FSL_IMX7_A7MPCORE_ADDR
);
213 for (i
= 0; i
< smp_cpus
; i
++) {
214 SysBusDevice
*sbd
= SYS_BUS_DEVICE(&s
->a7mpcore
);
215 DeviceState
*d
= DEVICE(qemu_get_cpu(i
));
217 irq
= qdev_get_gpio_in(d
, ARM_CPU_IRQ
);
218 sysbus_connect_irq(sbd
, i
, irq
);
219 irq
= qdev_get_gpio_in(d
, ARM_CPU_FIQ
);
220 sysbus_connect_irq(sbd
, i
+ smp_cpus
, irq
);
221 irq
= qdev_get_gpio_in(d
, ARM_CPU_VIRQ
);
222 sysbus_connect_irq(sbd
, i
+ 2 * smp_cpus
, irq
);
223 irq
= qdev_get_gpio_in(d
, ARM_CPU_VFIQ
);
224 sysbus_connect_irq(sbd
, i
+ 3 * smp_cpus
, irq
);
230 create_unimplemented_device("a7mpcore-dap", FSL_IMX7_A7MPCORE_DAP_ADDR
,
231 FSL_IMX7_A7MPCORE_DAP_SIZE
);
236 for (i
= 0; i
< FSL_IMX7_NUM_GPTS
; i
++) {
237 static const hwaddr FSL_IMX7_GPTn_ADDR
[FSL_IMX7_NUM_GPTS
] = {
244 static const int FSL_IMX7_GPTn_IRQ
[FSL_IMX7_NUM_GPTS
] = {
251 s
->gpt
[i
].ccm
= IMX_CCM(&s
->ccm
);
252 sysbus_realize(SYS_BUS_DEVICE(&s
->gpt
[i
]), &error_abort
);
253 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->gpt
[i
]), 0, FSL_IMX7_GPTn_ADDR
[i
]);
254 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->gpt
[i
]), 0,
255 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
256 FSL_IMX7_GPTn_IRQ
[i
]));
262 for (i
= 0; i
< FSL_IMX7_NUM_GPIOS
; i
++) {
263 static const hwaddr FSL_IMX7_GPIOn_ADDR
[FSL_IMX7_NUM_GPIOS
] = {
273 static const int FSL_IMX7_GPIOn_LOW_IRQ
[FSL_IMX7_NUM_GPIOS
] = {
274 FSL_IMX7_GPIO1_LOW_IRQ
,
275 FSL_IMX7_GPIO2_LOW_IRQ
,
276 FSL_IMX7_GPIO3_LOW_IRQ
,
277 FSL_IMX7_GPIO4_LOW_IRQ
,
278 FSL_IMX7_GPIO5_LOW_IRQ
,
279 FSL_IMX7_GPIO6_LOW_IRQ
,
280 FSL_IMX7_GPIO7_LOW_IRQ
,
283 static const int FSL_IMX7_GPIOn_HIGH_IRQ
[FSL_IMX7_NUM_GPIOS
] = {
284 FSL_IMX7_GPIO1_HIGH_IRQ
,
285 FSL_IMX7_GPIO2_HIGH_IRQ
,
286 FSL_IMX7_GPIO3_HIGH_IRQ
,
287 FSL_IMX7_GPIO4_HIGH_IRQ
,
288 FSL_IMX7_GPIO5_HIGH_IRQ
,
289 FSL_IMX7_GPIO6_HIGH_IRQ
,
290 FSL_IMX7_GPIO7_HIGH_IRQ
,
293 sysbus_realize(SYS_BUS_DEVICE(&s
->gpio
[i
]), &error_abort
);
294 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->gpio
[i
]), 0,
295 FSL_IMX7_GPIOn_ADDR
[i
]);
297 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->gpio
[i
]), 0,
298 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
299 FSL_IMX7_GPIOn_LOW_IRQ
[i
]));
301 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->gpio
[i
]), 1,
302 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
303 FSL_IMX7_GPIOn_HIGH_IRQ
[i
]));
307 * IOMUXC and IOMUXC_LPSR
309 create_unimplemented_device("iomuxc", FSL_IMX7_IOMUXC_ADDR
,
310 FSL_IMX7_IOMUXC_SIZE
);
311 create_unimplemented_device("iomuxc_lspr", FSL_IMX7_IOMUXC_LPSR_ADDR
,
312 FSL_IMX7_IOMUXC_LPSR_SIZE
);
317 sysbus_realize(SYS_BUS_DEVICE(&s
->ccm
), &error_abort
);
318 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->ccm
), 0, FSL_IMX7_CCM_ADDR
);
323 sysbus_realize(SYS_BUS_DEVICE(&s
->analog
), &error_abort
);
324 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->analog
), 0, FSL_IMX7_ANALOG_ADDR
);
329 sysbus_realize(SYS_BUS_DEVICE(&s
->gpcv2
), &error_abort
);
330 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->gpcv2
), 0, FSL_IMX7_GPC_ADDR
);
335 for (i
= 0; i
< FSL_IMX7_NUM_ECSPIS
; i
++) {
336 static const hwaddr FSL_IMX7_SPIn_ADDR
[FSL_IMX7_NUM_ECSPIS
] = {
337 FSL_IMX7_ECSPI1_ADDR
,
338 FSL_IMX7_ECSPI2_ADDR
,
339 FSL_IMX7_ECSPI3_ADDR
,
340 FSL_IMX7_ECSPI4_ADDR
,
343 static const int FSL_IMX7_SPIn_IRQ
[FSL_IMX7_NUM_ECSPIS
] = {
350 /* Initialize the SPI */
351 sysbus_realize(SYS_BUS_DEVICE(&s
->spi
[i
]), &error_abort
);
352 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->spi
[i
]), 0,
353 FSL_IMX7_SPIn_ADDR
[i
]);
354 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->spi
[i
]), 0,
355 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
356 FSL_IMX7_SPIn_IRQ
[i
]));
362 for (i
= 0; i
< FSL_IMX7_NUM_I2CS
; i
++) {
363 static const hwaddr FSL_IMX7_I2Cn_ADDR
[FSL_IMX7_NUM_I2CS
] = {
370 static const int FSL_IMX7_I2Cn_IRQ
[FSL_IMX7_NUM_I2CS
] = {
377 sysbus_realize(SYS_BUS_DEVICE(&s
->i2c
[i
]), &error_abort
);
378 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->i2c
[i
]), 0, FSL_IMX7_I2Cn_ADDR
[i
]);
380 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->i2c
[i
]), 0,
381 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
382 FSL_IMX7_I2Cn_IRQ
[i
]));
388 for (i
= 0; i
< FSL_IMX7_NUM_UARTS
; i
++) {
389 static const hwaddr FSL_IMX7_UARTn_ADDR
[FSL_IMX7_NUM_UARTS
] = {
399 static const int FSL_IMX7_UARTn_IRQ
[FSL_IMX7_NUM_UARTS
] = {
410 qdev_prop_set_chr(DEVICE(&s
->uart
[i
]), "chardev", serial_hd(i
));
412 sysbus_realize(SYS_BUS_DEVICE(&s
->uart
[i
]), &error_abort
);
414 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->uart
[i
]), 0, FSL_IMX7_UARTn_ADDR
[i
]);
416 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_UARTn_IRQ
[i
]);
417 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->uart
[i
]), 0, irq
);
423 * We must use two loops since phy_connected affects the other interface
424 * and we have to set all properties before calling sysbus_realize().
426 for (i
= 0; i
< FSL_IMX7_NUM_ETHS
; i
++) {
427 object_property_set_bool(OBJECT(&s
->eth
[i
]), "phy-connected",
428 s
->phy_connected
[i
], &error_abort
);
430 * If the MDIO bus on this controller is not connected, assume the
431 * other controller provides support for it.
433 if (!s
->phy_connected
[i
]) {
434 object_property_set_link(OBJECT(&s
->eth
[1 - i
]), "phy-consumer",
435 OBJECT(&s
->eth
[i
]), &error_abort
);
439 for (i
= 0; i
< FSL_IMX7_NUM_ETHS
; i
++) {
440 static const hwaddr FSL_IMX7_ENETn_ADDR
[FSL_IMX7_NUM_ETHS
] = {
445 object_property_set_uint(OBJECT(&s
->eth
[i
]), "phy-num",
446 s
->phy_num
[i
], &error_abort
);
447 object_property_set_uint(OBJECT(&s
->eth
[i
]), "tx-ring-num",
448 FSL_IMX7_ETH_NUM_TX_RINGS
, &error_abort
);
449 qdev_set_nic_properties(DEVICE(&s
->eth
[i
]), &nd_table
[i
]);
450 sysbus_realize(SYS_BUS_DEVICE(&s
->eth
[i
]), &error_abort
);
452 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->eth
[i
]), 0, FSL_IMX7_ENETn_ADDR
[i
]);
454 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_ENET_IRQ(i
, 0));
455 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->eth
[i
]), 0, irq
);
456 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_ENET_IRQ(i
, 3));
457 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->eth
[i
]), 1, irq
);
463 for (i
= 0; i
< FSL_IMX7_NUM_USDHCS
; i
++) {
464 static const hwaddr FSL_IMX7_USDHCn_ADDR
[FSL_IMX7_NUM_USDHCS
] = {
465 FSL_IMX7_USDHC1_ADDR
,
466 FSL_IMX7_USDHC2_ADDR
,
467 FSL_IMX7_USDHC3_ADDR
,
470 static const int FSL_IMX7_USDHCn_IRQ
[FSL_IMX7_NUM_USDHCS
] = {
476 object_property_set_uint(OBJECT(&s
->usdhc
[i
]), "vendor",
477 SDHCI_VENDOR_IMX
, &error_abort
);
478 sysbus_realize(SYS_BUS_DEVICE(&s
->usdhc
[i
]), &error_abort
);
480 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->usdhc
[i
]), 0,
481 FSL_IMX7_USDHCn_ADDR
[i
]);
483 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_USDHCn_IRQ
[i
]);
484 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->usdhc
[i
]), 0, irq
);
490 sysbus_realize(SYS_BUS_DEVICE(&s
->snvs
), &error_abort
);
491 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->snvs
), 0, FSL_IMX7_SNVS_HP_ADDR
);
496 sysbus_realize(SYS_BUS_DEVICE(&s
->src
), &error_abort
);
497 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->src
), 0, FSL_IMX7_SRC_ADDR
);
502 for (i
= 0; i
< FSL_IMX7_NUM_WDTS
; i
++) {
503 static const hwaddr FSL_IMX7_WDOGn_ADDR
[FSL_IMX7_NUM_WDTS
] = {
509 static const int FSL_IMX7_WDOGn_IRQ
[FSL_IMX7_NUM_WDTS
] = {
516 object_property_set_bool(OBJECT(&s
->wdt
[i
]), "pretimeout-support",
518 sysbus_realize(SYS_BUS_DEVICE(&s
->wdt
[i
]), &error_abort
);
520 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->wdt
[i
]), 0, FSL_IMX7_WDOGn_ADDR
[i
]);
521 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->wdt
[i
]), 0,
522 qdev_get_gpio_in(DEVICE(&s
->a7mpcore
),
523 FSL_IMX7_WDOGn_IRQ
[i
]));
529 create_unimplemented_device("sdma", FSL_IMX7_SDMA_ADDR
, FSL_IMX7_SDMA_SIZE
);
534 create_unimplemented_device("caam", FSL_IMX7_CAAM_ADDR
, FSL_IMX7_CAAM_SIZE
);
539 for (i
= 0; i
< FSL_IMX7_NUM_PWMS
; i
++) {
540 static const hwaddr FSL_IMX7_PWMn_ADDR
[FSL_IMX7_NUM_PWMS
] = {
547 snprintf(name
, NAME_SIZE
, "pwm%d", i
);
548 create_unimplemented_device(name
, FSL_IMX7_PWMn_ADDR
[i
],
555 for (i
= 0; i
< FSL_IMX7_NUM_CANS
; i
++) {
556 static const hwaddr FSL_IMX7_CANn_ADDR
[FSL_IMX7_NUM_CANS
] = {
561 snprintf(name
, NAME_SIZE
, "can%d", i
);
562 create_unimplemented_device(name
, FSL_IMX7_CANn_ADDR
[i
],
567 * SAIs (Audio SSI (Synchronous Serial Interface))
569 for (i
= 0; i
< FSL_IMX7_NUM_SAIS
; i
++) {
570 static const hwaddr FSL_IMX7_SAIn_ADDR
[FSL_IMX7_NUM_SAIS
] = {
576 snprintf(name
, NAME_SIZE
, "sai%d", i
);
577 create_unimplemented_device(name
, FSL_IMX7_SAIn_ADDR
[i
],
584 create_unimplemented_device("ocotp", FSL_IMX7_OCOTP_ADDR
,
585 FSL_IMX7_OCOTP_SIZE
);
590 sysbus_realize(SYS_BUS_DEVICE(&s
->gpr
), &error_abort
);
591 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->gpr
), 0, FSL_IMX7_IOMUXC_GPR_ADDR
);
596 sysbus_realize(SYS_BUS_DEVICE(&s
->pcie
), &error_abort
);
597 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->pcie
), 0, FSL_IMX7_PCIE_REG_ADDR
);
599 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_PCI_INTA_IRQ
);
600 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->pcie
), 0, irq
);
601 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_PCI_INTB_IRQ
);
602 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->pcie
), 1, irq
);
603 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_PCI_INTC_IRQ
);
604 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->pcie
), 2, irq
);
605 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_PCI_INTD_IRQ
);
606 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->pcie
), 3, irq
);
611 for (i
= 0; i
< FSL_IMX7_NUM_USBS
; i
++) {
612 static const hwaddr FSL_IMX7_USBMISCn_ADDR
[FSL_IMX7_NUM_USBS
] = {
613 FSL_IMX7_USBMISC1_ADDR
,
614 FSL_IMX7_USBMISC2_ADDR
,
615 FSL_IMX7_USBMISC3_ADDR
,
618 static const hwaddr FSL_IMX7_USBn_ADDR
[FSL_IMX7_NUM_USBS
] = {
624 static const int FSL_IMX7_USBn_IRQ
[FSL_IMX7_NUM_USBS
] = {
630 sysbus_realize(SYS_BUS_DEVICE(&s
->usb
[i
]), &error_abort
);
631 sysbus_mmio_map(SYS_BUS_DEVICE(&s
->usb
[i
]), 0,
632 FSL_IMX7_USBn_ADDR
[i
]);
634 irq
= qdev_get_gpio_in(DEVICE(&s
->a7mpcore
), FSL_IMX7_USBn_IRQ
[i
]);
635 sysbus_connect_irq(SYS_BUS_DEVICE(&s
->usb
[i
]), 0, irq
);
637 snprintf(name
, NAME_SIZE
, "usbmisc%d", i
);
638 create_unimplemented_device(name
, FSL_IMX7_USBMISCn_ADDR
[i
],
639 FSL_IMX7_USBMISCn_SIZE
);
645 for (i
= 0; i
< FSL_IMX7_NUM_ADCS
; i
++) {
646 static const hwaddr FSL_IMX7_ADCn_ADDR
[FSL_IMX7_NUM_ADCS
] = {
651 snprintf(name
, NAME_SIZE
, "adc%d", i
);
652 create_unimplemented_device(name
, FSL_IMX7_ADCn_ADDR
[i
],
659 create_unimplemented_device("lcdif", FSL_IMX7_LCDIF_ADDR
,
660 FSL_IMX7_LCDIF_SIZE
);
665 create_unimplemented_device("dma-apbh", FSL_IMX7_DMA_APBH_ADDR
,
666 FSL_IMX7_DMA_APBH_SIZE
);
670 create_unimplemented_device("pcie-phy", FSL_IMX7_PCIE_PHY_ADDR
,
671 FSL_IMX7_PCIE_PHY_SIZE
);
676 create_unimplemented_device("csu", FSL_IMX7_CSU_ADDR
,
682 create_unimplemented_device("tzasc", FSL_IMX7_TZASC_ADDR
,
683 FSL_IMX7_TZASC_SIZE
);
688 memory_region_init_ram(&s
->ocram
, NULL
, "imx7.ocram",
689 FSL_IMX7_OCRAM_MEM_SIZE
,
691 memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_MEM_ADDR
,
697 memory_region_init_ram(&s
->ocram_epdc
, NULL
, "imx7.ocram_epdc",
698 FSL_IMX7_OCRAM_EPDC_SIZE
,
700 memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_EPDC_ADDR
,
706 memory_region_init_ram(&s
->ocram_pxp
, NULL
, "imx7.ocram_pxp",
707 FSL_IMX7_OCRAM_PXP_SIZE
,
709 memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_PXP_ADDR
,
715 memory_region_init_ram(&s
->ocram_s
, NULL
, "imx7.ocram_s",
716 FSL_IMX7_OCRAM_S_SIZE
,
718 memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_S_ADDR
,
724 memory_region_init_rom(&s
->rom
, OBJECT(dev
), "imx7.rom",
725 FSL_IMX7_ROM_SIZE
, &error_abort
);
726 memory_region_add_subregion(get_system_memory(), FSL_IMX7_ROM_ADDR
,
732 memory_region_init_rom(&s
->caam
, OBJECT(dev
), "imx7.caam",
733 FSL_IMX7_CAAM_MEM_SIZE
, &error_abort
);
734 memory_region_add_subregion(get_system_memory(), FSL_IMX7_CAAM_MEM_ADDR
,
738 static Property fsl_imx7_properties
[] = {
739 DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State
, phy_num
[0], 0),
740 DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State
, phy_num
[1], 1),
741 DEFINE_PROP_BOOL("fec1-phy-connected", FslIMX7State
, phy_connected
[0],
743 DEFINE_PROP_BOOL("fec2-phy-connected", FslIMX7State
, phy_connected
[1],
745 DEFINE_PROP_END_OF_LIST(),
748 static void fsl_imx7_class_init(ObjectClass
*oc
, void *data
)
750 DeviceClass
*dc
= DEVICE_CLASS(oc
);
752 device_class_set_props(dc
, fsl_imx7_properties
);
753 dc
->realize
= fsl_imx7_realize
;
755 /* Reason: Uses serial_hds and nd_table in realize() directly */
756 dc
->user_creatable
= false;
757 dc
->desc
= "i.MX7 SOC";
760 static const TypeInfo fsl_imx7_type_info
= {
761 .name
= TYPE_FSL_IMX7
,
762 .parent
= TYPE_DEVICE
,
763 .instance_size
= sizeof(FslIMX7State
),
764 .instance_init
= fsl_imx7_init
,
765 .class_init
= fsl_imx7_class_init
,
768 static void fsl_imx7_register_types(void)
770 type_register_static(&fsl_imx7_type_info
);
772 type_init(fsl_imx7_register_types
)