Aspeed patches :
* New fp5280g2-bmc board (John) * Small cleanup in Aspeed SMC model (Cedric) -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmFybmYACgkQUaNDx8/7 7KEqzRAAigdJJDS+F7uVYN9srdu8GtbXKRaGYgBcaPIGMzC42Ot9hE46UMUPPbf/ 72QXynB09IvtkFgkX7xCaR3Lu1II7Ag+vf/VrjPltX1F05tdj9hTjPflJnPxWbBo 2nTU1vlUPXseaD5HQV/0ygYzqvbqyjCIhjSn0RKoMgKwrimBo52UByemOzh1unbV nS4eCtQZlUj8ZPiwKViXk1XHscVyQY/7NhTTgdAUzkU74eIlf+op/mMRl3RWMOma TsarphUoAfzCiYYZwg7IkWZWhTZt/zNR8OslNRfMbRFDfzFicCK3iu9L45jLaUix W+N8z0xt1QxjWjzAAqHWVaNQion9zZS1Y219pI7rS76FI7m5CNDQ394lD3Pz3fqk iW1JOtJACL9majRnZ58P7ScdVk68R/2Kt9VVcR93mkL4uAdrdxiWFScMssI1GmwR CQ6m/Ktupw2YPqx87qNprsjpJriEx7ooU5SGdKpX7eLf2v5pcQRXLArfHOmL6mCe xK0GGGTyz8E+GqzV8KciZpz9sEz0FoxPyqTjqboArvRPNCGnBvSSBISi24KXPXj3 MnOXiqLQ9BCAQRsSUMvWtof/X6DeAH7eQ8Pfk3+GxmnSsSInT6pOfbDESajMy7SY ADji7W87JzIPqXO46JCgKU5yXmxaNfUKrJHm5nH0nlmQDUVT21E= =qbBN -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/clg/tags/pull-aspeed-20211022' into staging Aspeed patches : * New fp5280g2-bmc board (John) * Small cleanup in Aspeed SMC model (Cedric) # gpg: Signature made Fri 22 Oct 2021 12:55:18 AM PDT # gpg: using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1 # gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: A0F6 6548 F048 95EB FE6B 0B60 51A3 43C7 CFFB ECA1 * remotes/clg/tags/pull-aspeed-20211022: speed/sdhci: Add trace events aspeed/smc: Use a container for the flash mmio address space aspeed: Add support for the fp5280g2-bmc board Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
eb8f1d57bd
@ -131,6 +131,21 @@ struct AspeedMachineState {
|
||||
SCU_HW_STRAP_VGA_SIZE_SET(VGA_64M_DRAM) | \
|
||||
SCU_AST2500_HW_STRAP_RESERVED1)
|
||||
|
||||
/* FP5280G2 hardware value: 0XF100D286 */
|
||||
#define FP5280G2_BMC_HW_STRAP1 ( \
|
||||
SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \
|
||||
SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \
|
||||
SCU_AST2500_HW_STRAP_UART_DEBUG | \
|
||||
SCU_AST2500_HW_STRAP_RESERVED28 | \
|
||||
SCU_AST2500_HW_STRAP_DDR4_ENABLE | \
|
||||
SCU_HW_STRAP_VGA_CLASS_CODE | \
|
||||
SCU_HW_STRAP_LPC_RESET_PIN | \
|
||||
SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER) | \
|
||||
SCU_AST2500_HW_STRAP_SET_AXI_AHB_RATIO(AXI_AHB_RATIO_2_1) | \
|
||||
SCU_HW_STRAP_MAC1_RGMII | \
|
||||
SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \
|
||||
SCU_AST2500_HW_STRAP_RESERVED1)
|
||||
|
||||
/* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */
|
||||
#define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1
|
||||
|
||||
@ -430,6 +445,15 @@ static void aspeed_machine_init(MachineState *machine)
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &aspeed_board_binfo);
|
||||
}
|
||||
|
||||
static void at24c_eeprom_init(I2CBus *bus, uint8_t addr, uint32_t rsize)
|
||||
{
|
||||
I2CSlave *i2c_dev = i2c_slave_new("at24c-eeprom", addr);
|
||||
DeviceState *dev = DEVICE(i2c_dev);
|
||||
|
||||
qdev_prop_set_uint32(dev, "rom-size", rsize);
|
||||
i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort);
|
||||
}
|
||||
|
||||
static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
|
||||
{
|
||||
AspeedSoCState *soc = &bmc->soc;
|
||||
@ -689,6 +713,34 @@ static void aspeed_eeprom_init(I2CBus *bus, uint8_t addr, uint32_t rsize)
|
||||
i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort);
|
||||
}
|
||||
|
||||
static void fp5280g2_bmc_i2c_init(AspeedMachineState *bmc)
|
||||
{
|
||||
AspeedSoCState *soc = &bmc->soc;
|
||||
I2CSlave *i2c_mux;
|
||||
|
||||
/* The at24c256 */
|
||||
at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x50, 32768);
|
||||
|
||||
/* The fp5280g2 expects a TMP112 but a TMP105 is compatible */
|
||||
i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), TYPE_TMP105,
|
||||
0x48);
|
||||
i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), TYPE_TMP105,
|
||||
0x49);
|
||||
|
||||
i2c_mux = i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2),
|
||||
"pca9546", 0x70);
|
||||
/* It expects a TMP112 but a TMP105 is compatible */
|
||||
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0), TYPE_TMP105,
|
||||
0x4a);
|
||||
|
||||
/* It expects a ds3232 but a ds1338 is good enough */
|
||||
i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "ds1338", 0x68);
|
||||
|
||||
/* It expects a pca9555 but a pca9552 is compatible */
|
||||
i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), TYPE_PCA9552,
|
||||
0x20);
|
||||
}
|
||||
|
||||
static void rainier_bmc_i2c_init(AspeedMachineState *bmc)
|
||||
{
|
||||
AspeedSoCState *soc = &bmc->soc;
|
||||
@ -1140,6 +1192,24 @@ static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data)
|
||||
aspeed_soc_num_cpus(amc->soc_name);
|
||||
};
|
||||
|
||||
static void aspeed_machine_fp5280g2_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
|
||||
|
||||
mc->desc = "Inspur FP5280G2 BMC (ARM1176)";
|
||||
amc->soc_name = "ast2500-a1";
|
||||
amc->hw_strap1 = FP5280G2_BMC_HW_STRAP1;
|
||||
amc->fmc_model = "n25q512a";
|
||||
amc->spi_model = "mx25l25635e";
|
||||
amc->num_cs = 2;
|
||||
amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON;
|
||||
amc->i2c_init = fp5280g2_bmc_i2c_init;
|
||||
mc->default_ram_size = 512 * MiB;
|
||||
mc->default_cpus = mc->min_cpus = mc->max_cpus =
|
||||
aspeed_soc_num_cpus(amc->soc_name);
|
||||
};
|
||||
|
||||
static void aspeed_machine_rainier_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
@ -1227,6 +1297,10 @@ static const TypeInfo aspeed_machine_types[] = {
|
||||
.name = MACHINE_TYPE_NAME("g220a-bmc"),
|
||||
.parent = TYPE_ASPEED_MACHINE,
|
||||
.class_init = aspeed_machine_g220a_class_init,
|
||||
}, {
|
||||
.name = MACHINE_TYPE_NAME("fp5280g2-bmc"),
|
||||
.parent = TYPE_ASPEED_MACHINE,
|
||||
.class_init = aspeed_machine_fp5280g2_class_init,
|
||||
}, {
|
||||
.name = MACHINE_TYPE_NAME("quanta-q71l-bmc"),
|
||||
.parent = TYPE_ASPEED_MACHINE,
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "hw/irq.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "trace.h"
|
||||
|
||||
#define ASPEED_SDHCI_INFO 0x00
|
||||
#define ASPEED_SDHCI_INFO_SLOT1 (1 << 17)
|
||||
@ -60,6 +61,8 @@ static uint64_t aspeed_sdhci_read(void *opaque, hwaddr addr, unsigned int size)
|
||||
}
|
||||
}
|
||||
|
||||
trace_aspeed_sdhci_read(addr, size, (uint64_t) val);
|
||||
|
||||
return (uint64_t)val;
|
||||
}
|
||||
|
||||
@ -68,6 +71,8 @@ static void aspeed_sdhci_write(void *opaque, hwaddr addr, uint64_t val,
|
||||
{
|
||||
AspeedSDHCIState *sdhci = opaque;
|
||||
|
||||
trace_aspeed_sdhci_write(addr, size, val);
|
||||
|
||||
switch (addr) {
|
||||
case ASPEED_SDHCI_INFO:
|
||||
/* The RESET bit automatically clears. */
|
||||
|
@ -68,3 +68,7 @@ pl181_fifo_push(uint32_t data) "FIFO push 0x%08" PRIx32
|
||||
pl181_fifo_pop(uint32_t data) "FIFO pop 0x%08" PRIx32
|
||||
pl181_fifo_transfer_complete(void) "FIFO transfer complete"
|
||||
pl181_data_engine_idle(void) "data engine idle"
|
||||
|
||||
# aspeed_sdhci.c
|
||||
aspeed_sdhci_read(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx64 " size %u: 0x%" PRIx64
|
||||
aspeed_sdhci_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx64 " size %u: 0x%" PRIx64
|
||||
|
@ -1151,14 +1151,17 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)
|
||||
* window in which the flash modules are mapped. The size and
|
||||
* address depends on the SoC model and controller type.
|
||||
*/
|
||||
memory_region_init(&s->mmio_flash_container, OBJECT(s),
|
||||
TYPE_ASPEED_SMC ".container",
|
||||
asc->flash_window_size);
|
||||
sysbus_init_mmio(sbd, &s->mmio_flash_container);
|
||||
|
||||
memory_region_init_io(&s->mmio_flash, OBJECT(s),
|
||||
&aspeed_smc_flash_default_ops, s,
|
||||
TYPE_ASPEED_SMC ".flash",
|
||||
asc->flash_window_size);
|
||||
memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s),
|
||||
TYPE_ASPEED_SMC ".flash",
|
||||
&s->mmio_flash, 0, asc->flash_window_size);
|
||||
sysbus_init_mmio(sbd, &s->mmio_flash_alias);
|
||||
memory_region_add_subregion(&s->mmio_flash_container, 0x0,
|
||||
&s->mmio_flash);
|
||||
|
||||
/*
|
||||
* Let's create a sub memory region for each possible peripheral. All
|
||||
|
@ -52,8 +52,8 @@ struct AspeedSMCState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion mmio;
|
||||
MemoryRegion mmio_flash_container;
|
||||
MemoryRegion mmio_flash;
|
||||
MemoryRegion mmio_flash_alias;
|
||||
|
||||
qemu_irq irq;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user