1 | The following changes since commit 2f4c51c0f384d7888a04b4815861e6d5fd244d75: | 1 | The following changes since commit de39a045bd8d2b49e4f3d07976622c29d58e0bac: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200831-pull-request' into staging (2020-08-31 19:39:13 +0100) | 3 | Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200915-pull-request' into staging (2020-09-15 14:25:05 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://github.com/legoater/qemu/ tags/pull-aspeed-20200901 | 7 | https://github.com/legoater/qemu/ tags/pull-aspeed-20200918 |
8 | 8 | ||
9 | for you to fetch changes up to ddd8ab19749b8639fc08bfe4d0df0204eec049f0: | 9 | for you to fetch changes up to 204dab83fe00a3e0781d93ad7899192a9409e987: |
10 | 10 | ||
11 | hw: add a number of SPI-flash's of m25p80 family (2020-09-01 14:21:51 +0200) | 11 | misc: aspeed_scu: Update AST2600 silicon id register (2020-09-18 09:04:36 +0200) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Various fixes of Aspeed machines : | 14 | Aspeed patches : |
15 | 15 | ||
16 | * New Supermicro X11 BMC machine (Erik) | 16 | * Couple of cleanups |
17 | * Fixed valid access size on AST2400 SCU | 17 | * New machine properties to define the flash models |
18 | * Improved robustness of the ftgmac100 model. | ||
19 | * New flash models in m25p80 (Igor) | ||
20 | * Fixed reset sequence of SDHCI/eMMC controllers | ||
21 | * Improved support of the AST2600 SDMC (Joel) | ||
22 | * Couple of SMC cleanups | ||
23 | 18 | ||
24 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
25 | Cédric Le Goater (15): | 20 | Cédric Le Goater (1): |
26 | m25p80: Return the JEDEC ID twice for mx25l25635e | 21 | hw/arm/aspeed: Add machine properties to define the flash models |
27 | m25p80: Add support for n25q512ax3 | ||
28 | aspeed/scu: Fix valid access size on AST2400 | ||
29 | aspeed/smc: Fix MemoryRegionOps definition | ||
30 | aspeed/smc: Fix max_slaves of the legacy SMC device | ||
31 | aspeed/sdhci: Fix reset sequence | ||
32 | ftgmac100: Fix registers that can be read | ||
33 | ftgmac100: Fix interrupt status "Packet transmitted on ethernet" | ||
34 | ftgmac100: Fix interrupt status "Packet moved to RX FIFO" | ||
35 | ftgmac100: Change interrupt status when a DMA error occurs | ||
36 | ftgmac100: Check for invalid len and address before doing a DMA transfer | ||
37 | ftgmac100: Fix integer overflow in ftgmac100_do_tx() | ||
38 | ftgmac100: Improve software reset | ||
39 | aspeed/sdmc: Simplify calculation of RAM bits | ||
40 | aspeed/smc: Open AHB window of the second chip of the AST2600 FMC controller | ||
41 | 22 | ||
42 | Erik Smit (1): | 23 | Joel Stanley (1): |
43 | hw/arm/aspeed: Add board model for Supermicro X11 BMC | 24 | misc: aspeed_scu: Update AST2600 silicon id register |
44 | 25 | ||
45 | Igor Kononenko (2): | 26 | Philippe Mathieu-Daudé (1): |
46 | arm: aspeed: add strap define `25HZ` of AST2500 | 27 | hw/arm/aspeed: Map the UART5 device unconditionally |
47 | hw: add a number of SPI-flash's of m25p80 family | ||
48 | 28 | ||
49 | Joel Stanley (2): | 29 | docs/system/arm/aspeed.rst | 18 ++++++++++++++++++ |
50 | aspeed/sdmc: Perform memory training | 30 | hw/arm/aspeed.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- |
51 | aspeed/sdmc: Allow writes to unprotected registers | 31 | hw/arm/aspeed_ast2600.c | 8 +++----- |
32 | hw/arm/aspeed_soc.c | 8 +++----- | ||
33 | hw/misc/aspeed_scu.c | 7 ++++++- | ||
34 | 5 files changed, 73 insertions(+), 13 deletions(-) | ||
52 | 35 | ||
53 | include/hw/misc/aspeed_scu.h | 1 + | ||
54 | include/hw/misc/aspeed_sdmc.h | 13 ++++- | ||
55 | hw/arm/aspeed.c | 35 ++++++++++++ | ||
56 | hw/block/m25p80.c | 5 +- | ||
57 | hw/misc/aspeed_scu.c | 9 +-- | ||
58 | hw/misc/aspeed_sdmc.c | 125 +++++++++++++++++++++++------------------- | ||
59 | hw/net/ftgmac100.c | 95 +++++++++++++++++++++++--------- | ||
60 | hw/sd/aspeed_sdhci.c | 14 ++++- | ||
61 | hw/ssi/aspeed_smc.c | 6 +- | ||
62 | 9 files changed, 208 insertions(+), 95 deletions(-) | ||
63 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The mx25l25635e returns the JEDEC ID twice when issuing a RDID command : | ||
2 | 1 | ||
3 | [ 2.512027] aspeed-smc 1e630000.spi: reading JEDEC ID C2:20:19:C2:20:19 | ||
4 | |||
5 | This can break some firmware testing for this condition on the | ||
6 | supermicrox11-bmc machine. | ||
7 | |||
8 | Reported-by: Erik Smit <erik.lucas.smit@gmail.com> | ||
9 | Message-Id: <20200819100956.2216690-2-clg@kaod.org> | ||
10 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
11 | --- | ||
12 | hw/block/m25p80.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/block/m25p80.c | ||
18 | +++ b/hw/block/m25p80.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static const FlashPartInfo known_devices[] = { | ||
20 | { INFO("mx25l6405d", 0xc22017, 0, 64 << 10, 128, 0) }, | ||
21 | { INFO("mx25l12805d", 0xc22018, 0, 64 << 10, 256, 0) }, | ||
22 | { INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) }, | ||
23 | - { INFO("mx25l25635e", 0xc22019, 0, 64 << 10, 512, 0) }, | ||
24 | + { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512, 0) }, | ||
25 | { INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) }, | ||
26 | { INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) }, | ||
27 | { INFO("mx66u1g45g", 0xc2253b, 0, 64 << 10, 2048, ER_4K | ER_32K) }, | ||
28 | -- | ||
29 | 2.25.4 | ||
30 | |||
31 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Datasheet available here : | ||
2 | 1 | ||
3 | https://www.micron.com/-/media/client/global/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_512mb_1ce_3v_65nm.pdf | ||
4 | |||
5 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
6 | Message-Id: <20200819100956.2216690-4-clg@kaod.org> | ||
7 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
8 | --- | ||
9 | hw/block/m25p80.c | 1 + | ||
10 | 1 file changed, 1 insertion(+) | ||
11 | |||
12 | diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/hw/block/m25p80.c | ||
15 | +++ b/hw/block/m25p80.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static const FlashPartInfo known_devices[] = { | ||
17 | { INFO("n25q128", 0x20ba18, 0, 64 << 10, 256, 0) }, | ||
18 | { INFO("n25q256a", 0x20ba19, 0, 64 << 10, 512, ER_4K) }, | ||
19 | { INFO("n25q512a", 0x20ba20, 0, 64 << 10, 1024, ER_4K) }, | ||
20 | + { INFO("n25q512ax3", 0x20ba20, 0x1000, 64 << 10, 1024, ER_4K) }, | ||
21 | { INFO_STACKED("n25q00", 0x20ba21, 0x1000, 64 << 10, 2048, ER_4K, 4) }, | ||
22 | { INFO_STACKED("n25q00a", 0x20bb21, 0x1000, 64 << 10, 2048, ER_4K, 4) }, | ||
23 | { INFO_STACKED("mt25ql01g", 0x20ba21, 0x1040, 64 << 10, 2048, ER_4K, 2) }, | ||
24 | -- | ||
25 | 2.25.4 | ||
26 | |||
27 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The read access size of the SCU registers can be 1/2/4 bytes and write | ||
2 | is 4 bytes and all Aspeed models would need a .valid.accepts() handler. | ||
3 | 1 | ||
4 | For the moment, set the min access size to 1 byte to cover both read | ||
5 | and write operations on the AST2400 but keep the min access size of | ||
6 | the other SoCs to 4 bytes as this is an unusual access size. | ||
7 | |||
8 | This fixes support for some old firmware doing 2 bytes reads on the | ||
9 | AST2400 SoC. | ||
10 | |||
11 | Reported-by: Erik Smit <erik.lucas.smit@gmail.com> | ||
12 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
13 | Message-Id: <20200819100956.2216690-5-clg@kaod.org> | ||
14 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
15 | --- | ||
16 | hw/misc/aspeed_scu.c | 7 ++++--- | ||
17 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/hw/misc/aspeed_scu.c | ||
22 | +++ b/hw/misc/aspeed_scu.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_ast2400_scu_ops = { | ||
24 | .read = aspeed_scu_read, | ||
25 | .write = aspeed_ast2400_scu_write, | ||
26 | .endianness = DEVICE_LITTLE_ENDIAN, | ||
27 | - .valid.min_access_size = 4, | ||
28 | - .valid.max_access_size = 4, | ||
29 | - .valid.unaligned = false, | ||
30 | + .valid = { | ||
31 | + .min_access_size = 1, | ||
32 | + .max_access_size = 4, | ||
33 | + }, | ||
34 | }; | ||
35 | |||
36 | static const MemoryRegionOps aspeed_ast2500_scu_ops = { | ||
37 | -- | ||
38 | 2.25.4 | ||
39 | |||
40 | diff view generated by jsdifflib |
1 | As we don't model the RX or TX FIFO, raise the "Packet moved to RX | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | FIFO" interrupt status bit as soon as we are handling a RX packet. | ||
3 | 2 | ||
4 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | 3 | The UART5 is present on the machine regardless there is a |
5 | Reviewed-by: Joel Stanley <joel@jms.id.au> | 4 | character device connected to it. Map it unconditionally. |
6 | Message-Id: <20200819100956.2216690-12-clg@kaod.org> | 5 | |
6 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
8 | Message-Id: <20200905212415.760452-1-f4bug@amsat.org> | ||
7 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | 9 | Signed-off-by: Cédric Le Goater <clg@kaod.org> |
8 | --- | 10 | --- |
9 | hw/net/ftgmac100.c | 3 +-- | 11 | hw/arm/aspeed_ast2600.c | 8 +++----- |
10 | 1 file changed, 1 insertion(+), 2 deletions(-) | 12 | hw/arm/aspeed_soc.c | 8 +++----- |
13 | 2 files changed, 6 insertions(+), 10 deletions(-) | ||
11 | 14 | ||
12 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | 15 | diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/hw/net/ftgmac100.c | 17 | --- a/hw/arm/aspeed_ast2600.c |
15 | +++ b/hw/net/ftgmac100.c | 18 | +++ b/hw/arm/aspeed_ast2600.c |
16 | @@ -XXX,XX +XXX,XX @@ static ssize_t ftgmac100_receive(NetClientState *nc, const uint8_t *buf, | 19 | @@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp) |
17 | break; | ||
18 | } | 20 | } |
19 | 21 | ||
20 | + s->isr |= FTGMAC100_INT_RPKT_FIFO; | 22 | /* UART - attach an 8250 to the IO space as our UART5 */ |
21 | addr = s->rx_descriptor; | 23 | - if (serial_hd(0)) { |
22 | while (size > 0) { | 24 | - qemu_irq uart5 = aspeed_soc_get_irq(s, ASPEED_DEV_UART5); |
23 | if (!ftgmac100_can_receive(nc)) { | 25 | - serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2, |
24 | @@ -XXX,XX +XXX,XX @@ static ssize_t ftgmac100_receive(NetClientState *nc, const uint8_t *buf, | 26 | - uart5, 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); |
25 | /* Last buffer in frame. */ | 27 | - } |
26 | bd.des0 |= flags | FTGMAC100_RXDES0_LRS; | 28 | + serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2, |
27 | s->isr |= FTGMAC100_INT_RPKT_BUF; | 29 | + aspeed_soc_get_irq(s, ASPEED_DEV_UART5), |
28 | - } else { | 30 | + 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); |
29 | - s->isr |= FTGMAC100_INT_RPKT_FIFO; | 31 | |
30 | } | 32 | /* I2C */ |
31 | ftgmac100_write_bd(&bd, addr); | 33 | object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr), |
32 | if (bd.des0 & s->rxdes0_edorr) { | 34 | diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c |
35 | index XXXXXXX..XXXXXXX 100644 | ||
36 | --- a/hw/arm/aspeed_soc.c | ||
37 | +++ b/hw/arm/aspeed_soc.c | ||
38 | @@ -XXX,XX +XXX,XX @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) | ||
39 | } | ||
40 | |||
41 | /* UART - attach an 8250 to the IO space as our UART5 */ | ||
42 | - if (serial_hd(0)) { | ||
43 | - qemu_irq uart5 = aspeed_soc_get_irq(s, ASPEED_DEV_UART5); | ||
44 | - serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2, | ||
45 | - uart5, 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); | ||
46 | - } | ||
47 | + serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2, | ||
48 | + aspeed_soc_get_irq(s, ASPEED_DEV_UART5), 38400, | ||
49 | + serial_hd(0), DEVICE_LITTLE_ENDIAN); | ||
50 | |||
51 | /* I2C */ | ||
52 | object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr), | ||
33 | -- | 53 | -- |
34 | 2.25.4 | 54 | 2.25.4 |
35 | 55 | ||
36 | 56 | diff view generated by jsdifflib |
1 | From: Erik Smit <erik.lucas.smit@gmail.com> | 1 | Some machines don't have much differences a part from the flash model |
---|---|---|---|
2 | being used. Introduce new machine properties to change them from the | ||
3 | command line. | ||
2 | 4 | ||
3 | The BMC Firmware can be downloaded from : | 5 | For instance, to start the ast2500-evb machine with a different FMC |
6 | chip and a 64M SPI chip, use : | ||
4 | 7 | ||
5 | https://www.supermicro.com/en/products/motherboard/X11SSL-F | 8 | -M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f |
6 | 9 | ||
7 | Signed-off-by: Erik Smit <erik.lucas.smit@gmail.com> | 10 | Cc: 郁雷 <yulei.sh@bytedance.com> |
8 | Reviewed-by: Joel Stanley <joel@jms.id.au> | 11 | Reviewed-by: Joel Stanley <joel@jms.id.au> |
9 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | 12 | Tested-by: Lei YU <yulei.sh@bytedance.com> |
10 | [ clg: Prettified Erik's name in email | 13 | Message-Id: <20200915054859.2338477-1-clg@kaod.org> |
11 | Modified commit log ] | ||
12 | Message-Id: <20200715173418.186-1-erik.lucas.smit@gmail.com> | ||
13 | Message-Id: <20200819100956.2216690-6-clg@kaod.org> | ||
14 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | 14 | Signed-off-by: Cédric Le Goater <clg@kaod.org> |
15 | --- | 15 | --- |
16 | hw/arm/aspeed.c | 35 +++++++++++++++++++++++++++++++++++ | 16 | docs/system/arm/aspeed.rst | 18 +++++++++++++++ |
17 | 1 file changed, 35 insertions(+) | 17 | hw/arm/aspeed.c | 45 ++++++++++++++++++++++++++++++++++++-- |
18 | 2 files changed, 61 insertions(+), 2 deletions(-) | ||
18 | 19 | ||
20 | diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/docs/system/arm/aspeed.rst | ||
23 | +++ b/docs/system/arm/aspeed.rst | ||
24 | @@ -XXX,XX +XXX,XX @@ The image should be attached as an MTD drive. Run : | ||
25 | |||
26 | $ qemu-system-arm -M romulus-bmc -nic user \ | ||
27 | -drive file=flash-romulus,format=raw,if=mtd -nographic | ||
28 | + | ||
29 | +Options specific to Aspeed machines are : | ||
30 | + | ||
31 | + * ``execute-in-place`` which emulates the boot from the CE0 flash | ||
32 | + device by using the FMC controller to load the instructions, and | ||
33 | + not simply from RAM. This takes a little longer. | ||
34 | + | ||
35 | + * ``fmc-model`` to change the FMC Flash model. FW needs support for | ||
36 | + the chip model to boot. | ||
37 | + | ||
38 | + * ``spi-model`` to change the SPI Flash model. | ||
39 | + | ||
40 | +For instance, to start the ``ast2500-evb`` machine with a different | ||
41 | +FMC chip and a bigger (64M) SPI chip, use : | ||
42 | + | ||
43 | +.. code-block:: bash | ||
44 | + | ||
45 | + -M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f | ||
19 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | 46 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c |
20 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/hw/arm/aspeed.c | 48 | --- a/hw/arm/aspeed.c |
22 | +++ b/hw/arm/aspeed.c | 49 | +++ b/hw/arm/aspeed.c |
23 | @@ -XXX,XX +XXX,XX @@ struct AspeedMachineState { | 50 | @@ -XXX,XX +XXX,XX @@ struct AspeedMachineState { |
24 | SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \ | 51 | MemoryRegion ram_container; |
25 | SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT)) | 52 | MemoryRegion max_ram; |
26 | 53 | bool mmio_exec; | |
27 | +/* TODO: Find the actual hardware value */ | 54 | + char *fmc_model; |
28 | +#define SUPERMICROX11_BMC_HW_STRAP1 ( \ | 55 | + char *spi_model; |
29 | + SCU_AST2400_HW_STRAP_DRAM_SIZE(DRAM_SIZE_128MB) | \ | ||
30 | + SCU_AST2400_HW_STRAP_DRAM_CONFIG(2) | \ | ||
31 | + SCU_AST2400_HW_STRAP_ACPI_DIS | \ | ||
32 | + SCU_AST2400_HW_STRAP_SET_CLK_SOURCE(AST2400_CLK_48M_IN) | \ | ||
33 | + SCU_HW_STRAP_VGA_CLASS_CODE | \ | ||
34 | + SCU_HW_STRAP_LPC_RESET_PIN | \ | ||
35 | + SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_M_S_EN) | \ | ||
36 | + SCU_AST2400_HW_STRAP_SET_CPU_AHB_RATIO(AST2400_CPU_AHB_RATIO_2_1) | \ | ||
37 | + SCU_HW_STRAP_SPI_WIDTH | \ | ||
38 | + SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \ | ||
39 | + SCU_AST2400_HW_STRAP_BOOT_MODE(AST2400_SPI_BOOT)) | ||
40 | + | ||
41 | /* AST2500 evb hardware value: 0xF100C2E6 */ | ||
42 | #define AST2500_EVB_HW_STRAP1 (( \ | ||
43 | AST2500_HW_STRAP1_DEFAULTS | \ | ||
44 | @@ -XXX,XX +XXX,XX @@ static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data) | ||
45 | aspeed_soc_num_cpus(amc->soc_name); | ||
46 | }; | 56 | }; |
47 | 57 | ||
48 | +static void aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, | 58 | /* Palmetto hardware value: 0x120CE416 */ |
49 | + void *data) | 59 | @@ -XXX,XX +XXX,XX @@ static void aspeed_machine_init(MachineState *machine) |
60 | "max_ram", max_ram_size - ram_size); | ||
61 | memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_ram); | ||
62 | |||
63 | - aspeed_board_init_flashes(&bmc->soc.fmc, amc->fmc_model); | ||
64 | - aspeed_board_init_flashes(&bmc->soc.spi[0], amc->spi_model); | ||
65 | + aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ? | ||
66 | + bmc->fmc_model : amc->fmc_model); | ||
67 | + aspeed_board_init_flashes(&bmc->soc.spi[0], bmc->spi_model ? | ||
68 | + bmc->spi_model : amc->spi_model); | ||
69 | |||
70 | /* Install first FMC flash content as a boot rom. */ | ||
71 | if (drive0) { | ||
72 | @@ -XXX,XX +XXX,XX @@ static void aspeed_machine_instance_init(Object *obj) | ||
73 | ASPEED_MACHINE(obj)->mmio_exec = false; | ||
74 | } | ||
75 | |||
76 | +static char *aspeed_get_fmc_model(Object *obj, Error **errp) | ||
50 | +{ | 77 | +{ |
51 | + MachineClass *mc = MACHINE_CLASS(oc); | 78 | + AspeedMachineState *bmc = ASPEED_MACHINE(obj); |
52 | + AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc); | 79 | + return g_strdup(bmc->fmc_model); |
53 | + | ||
54 | + mc->desc = "Supermicro X11 BMC (ARM926EJ-S)"; | ||
55 | + amc->soc_name = "ast2400-a1"; | ||
56 | + amc->hw_strap1 = SUPERMICROX11_BMC_HW_STRAP1; | ||
57 | + amc->fmc_model = "mx25l25635e"; | ||
58 | + amc->spi_model = "mx25l25635e"; | ||
59 | + amc->num_cs = 1; | ||
60 | + amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON; | ||
61 | + amc->i2c_init = palmetto_bmc_i2c_init; | ||
62 | + mc->default_ram_size = 256 * MiB; | ||
63 | +} | 80 | +} |
64 | + | 81 | + |
65 | static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *data) | 82 | +static void aspeed_set_fmc_model(Object *obj, const char *value, Error **errp) |
83 | +{ | ||
84 | + AspeedMachineState *bmc = ASPEED_MACHINE(obj); | ||
85 | + | ||
86 | + g_free(bmc->fmc_model); | ||
87 | + bmc->fmc_model = g_strdup(value); | ||
88 | +} | ||
89 | + | ||
90 | +static char *aspeed_get_spi_model(Object *obj, Error **errp) | ||
91 | +{ | ||
92 | + AspeedMachineState *bmc = ASPEED_MACHINE(obj); | ||
93 | + return g_strdup(bmc->spi_model); | ||
94 | +} | ||
95 | + | ||
96 | +static void aspeed_set_spi_model(Object *obj, const char *value, Error **errp) | ||
97 | +{ | ||
98 | + AspeedMachineState *bmc = ASPEED_MACHINE(obj); | ||
99 | + | ||
100 | + g_free(bmc->spi_model); | ||
101 | + bmc->spi_model = g_strdup(value); | ||
102 | +} | ||
103 | + | ||
104 | static void aspeed_machine_class_props_init(ObjectClass *oc) | ||
66 | { | 105 | { |
67 | MachineClass *mc = MACHINE_CLASS(oc); | 106 | object_class_property_add_bool(oc, "execute-in-place", |
68 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_machine_types[] = { | 107 | @@ -XXX,XX +XXX,XX @@ static void aspeed_machine_class_props_init(ObjectClass *oc) |
69 | .name = MACHINE_TYPE_NAME("palmetto-bmc"), | 108 | aspeed_set_mmio_exec); |
70 | .parent = TYPE_ASPEED_MACHINE, | 109 | object_class_property_set_description(oc, "execute-in-place", |
71 | .class_init = aspeed_machine_palmetto_class_init, | 110 | "boot directly from CE0 flash device"); |
72 | + }, { | 111 | + |
73 | + .name = MACHINE_TYPE_NAME("supermicrox11-bmc"), | 112 | + object_class_property_add_str(oc, "fmc-model", aspeed_get_fmc_model, |
74 | + .parent = TYPE_ASPEED_MACHINE, | 113 | + aspeed_set_fmc_model); |
75 | + .class_init = aspeed_machine_supermicrox11_bmc_class_init, | 114 | + object_class_property_set_description(oc, "fmc-model", |
76 | }, { | 115 | + "Change the FMC Flash model"); |
77 | .name = MACHINE_TYPE_NAME("ast2500-evb"), | 116 | + object_class_property_add_str(oc, "spi-model", aspeed_get_spi_model, |
78 | .parent = TYPE_ASPEED_MACHINE, | 117 | + aspeed_set_spi_model); |
118 | + object_class_property_set_description(oc, "spi-model", | ||
119 | + "Change the SPI Flash model"); | ||
120 | } | ||
121 | |||
122 | static int aspeed_soc_num_cpus(const char *soc_name) | ||
79 | -- | 123 | -- |
80 | 2.25.4 | 124 | 2.25.4 |
81 | 125 | ||
82 | 126 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Unaligned access support is a leftover from the initial commit. There | ||
2 | is no such need on this device register mapping. Remove it. | ||
3 | 1 | ||
4 | Cc: Michael S. Tsirkin <mst@redhat.com> | ||
5 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
6 | Message-Id: <20200819100956.2216690-7-clg@kaod.org> | ||
7 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
8 | --- | ||
9 | hw/ssi/aspeed_smc.c | 2 -- | ||
10 | 1 file changed, 2 deletions(-) | ||
11 | |||
12 | diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/hw/ssi/aspeed_smc.c | ||
15 | +++ b/hw/ssi/aspeed_smc.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_smc_ops = { | ||
17 | .read = aspeed_smc_read, | ||
18 | .write = aspeed_smc_write, | ||
19 | .endianness = DEVICE_LITTLE_ENDIAN, | ||
20 | - .valid.unaligned = true, | ||
21 | }; | ||
22 | |||
23 | - | ||
24 | /* | ||
25 | * Initialize the custom address spaces for DMAs | ||
26 | */ | ||
27 | -- | ||
28 | 2.25.4 | ||
29 | |||
30 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The legacy controller only has one slave. | ||
2 | 1 | ||
3 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
4 | Message-Id: <20200819100956.2216690-8-clg@kaod.org> | ||
5 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
6 | --- | ||
7 | hw/ssi/aspeed_smc.c | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c | ||
11 | index XXXXXXX..XXXXXXX 100644 | ||
12 | --- a/hw/ssi/aspeed_smc.c | ||
13 | +++ b/hw/ssi/aspeed_smc.c | ||
14 | @@ -XXX,XX +XXX,XX @@ static const AspeedSMCController controllers[] = { | ||
15 | .r_timings = R_TIMINGS, | ||
16 | .nregs_timings = 1, | ||
17 | .conf_enable_w0 = CONF_ENABLE_W0, | ||
18 | - .max_slaves = 5, | ||
19 | + .max_slaves = 1, | ||
20 | .segments = aspeed_segments_legacy, | ||
21 | .flash_window_base = ASPEED_SOC_SMC_FLASH_BASE, | ||
22 | .flash_window_size = 0x6000000, | ||
23 | -- | ||
24 | 2.25.4 | ||
25 | |||
26 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | BIT(0) of the ASPEED_SDHCI_INFO register is set by SW and polled until | ||
2 | the bit is cleared by HW. | ||
3 | 1 | ||
4 | Use the number of supported slots to define the default value of this | ||
5 | register (The AST2600 eMMC Controller only has one). Fix the reset | ||
6 | sequence by clearing automatically the RESET bit. | ||
7 | |||
8 | Cc: Eddie James <eajames@linux.ibm.com> | ||
9 | Fixes: 2bea128c3d0b ("hw/sd/aspeed_sdhci: New device") | ||
10 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
11 | Message-Id: <20200819100956.2216690-9-clg@kaod.org> | ||
12 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
13 | --- | ||
14 | hw/sd/aspeed_sdhci.c | 14 ++++++++++++-- | ||
15 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/sd/aspeed_sdhci.c | ||
20 | +++ b/hw/sd/aspeed_sdhci.c | ||
21 | @@ -XXX,XX +XXX,XX @@ | ||
22 | #include "hw/qdev-properties.h" | ||
23 | |||
24 | #define ASPEED_SDHCI_INFO 0x00 | ||
25 | -#define ASPEED_SDHCI_INFO_RESET 0x00030000 | ||
26 | +#define ASPEED_SDHCI_INFO_SLOT1 (1 << 17) | ||
27 | +#define ASPEED_SDHCI_INFO_SLOT0 (1 << 16) | ||
28 | +#define ASPEED_SDHCI_INFO_RESET (1 << 0) | ||
29 | #define ASPEED_SDHCI_DEBOUNCE 0x04 | ||
30 | #define ASPEED_SDHCI_DEBOUNCE_RESET 0x00000005 | ||
31 | #define ASPEED_SDHCI_BUS 0x08 | ||
32 | @@ -XXX,XX +XXX,XX @@ static void aspeed_sdhci_write(void *opaque, hwaddr addr, uint64_t val, | ||
33 | AspeedSDHCIState *sdhci = opaque; | ||
34 | |||
35 | switch (addr) { | ||
36 | + case ASPEED_SDHCI_INFO: | ||
37 | + /* The RESET bit automatically clears. */ | ||
38 | + sdhci->regs[TO_REG(addr)] = (uint32_t)val & ~ASPEED_SDHCI_INFO_RESET; | ||
39 | + break; | ||
40 | case ASPEED_SDHCI_SDIO_140: | ||
41 | sdhci->slots[0].capareg = (uint64_t)(uint32_t)val; | ||
42 | break; | ||
43 | @@ -XXX,XX +XXX,XX @@ static void aspeed_sdhci_reset(DeviceState *dev) | ||
44 | AspeedSDHCIState *sdhci = ASPEED_SDHCI(dev); | ||
45 | |||
46 | memset(sdhci->regs, 0, ASPEED_SDHCI_REG_SIZE); | ||
47 | - sdhci->regs[TO_REG(ASPEED_SDHCI_INFO)] = ASPEED_SDHCI_INFO_RESET; | ||
48 | + | ||
49 | + sdhci->regs[TO_REG(ASPEED_SDHCI_INFO)] = ASPEED_SDHCI_INFO_SLOT0; | ||
50 | + if (sdhci->num_slots == 2) { | ||
51 | + sdhci->regs[TO_REG(ASPEED_SDHCI_INFO)] |= ASPEED_SDHCI_INFO_SLOT1; | ||
52 | + } | ||
53 | sdhci->regs[TO_REG(ASPEED_SDHCI_DEBOUNCE)] = ASPEED_SDHCI_DEBOUNCE_RESET; | ||
54 | } | ||
55 | |||
56 | -- | ||
57 | 2.25.4 | ||
58 | |||
59 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Receive Ring Base Address Register (RXR_BADR) and the Normal Priority | ||
2 | Transmit Receive Ring Base Address Register (NPTXR_BADR) can also be | ||
3 | read. | ||
4 | 1 | ||
5 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
8 | Message-Id: <20200819100956.2216690-10-clg@kaod.org> | ||
9 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
10 | --- | ||
11 | hw/net/ftgmac100.c | 4 ++++ | ||
12 | 1 file changed, 4 insertions(+) | ||
13 | |||
14 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/net/ftgmac100.c | ||
17 | +++ b/hw/net/ftgmac100.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static uint64_t ftgmac100_read(void *opaque, hwaddr addr, unsigned size) | ||
19 | return s->math[0]; | ||
20 | case FTGMAC100_MATH1: | ||
21 | return s->math[1]; | ||
22 | + case FTGMAC100_RXR_BADR: | ||
23 | + return s->rx_ring; | ||
24 | + case FTGMAC100_NPTXR_BADR: | ||
25 | + return s->tx_ring; | ||
26 | case FTGMAC100_ITC: | ||
27 | return s->itc; | ||
28 | case FTGMAC100_DBLAC: | ||
29 | -- | ||
30 | 2.25.4 | ||
31 | |||
32 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The second field of the TX descriptor has a set of flags to choose | ||
2 | when the transmit interrupt is raised : after the packet has been sent | ||
3 | on the ethernet or after it has been moved into the TX FIFO. But we | ||
4 | don't model that today. | ||
5 | 1 | ||
6 | Simply raise the "Packet transmitted on ethernet" interrupt status bit | ||
7 | as soon as the packet is sent by QEMU. | ||
8 | |||
9 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
10 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
11 | Message-Id: <20200819100956.2216690-11-clg@kaod.org> | ||
12 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
13 | --- | ||
14 | hw/net/ftgmac100.c | 4 +--- | ||
15 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
16 | |||
17 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/net/ftgmac100.c | ||
20 | +++ b/hw/net/ftgmac100.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, | ||
22 | qemu_send_packet(qemu_get_queue(s->nic), s->frame, frame_size); | ||
23 | ptr = s->frame; | ||
24 | frame_size = 0; | ||
25 | - if (flags & FTGMAC100_TXDES1_TXIC) { | ||
26 | - s->isr |= FTGMAC100_INT_XPKT_ETH; | ||
27 | - } | ||
28 | + s->isr |= FTGMAC100_INT_XPKT_ETH; | ||
29 | } | ||
30 | |||
31 | if (flags & FTGMAC100_TXDES1_TX2FIC) { | ||
32 | -- | ||
33 | 2.25.4 | ||
34 | |||
35 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The model uses today the "Normal priority transmit buffer unavailable" | ||
2 | interrupt status which it is not appropriate. According to the Aspeed | ||
3 | specs, no interrupts are raised in that case. An "AHB error" status | ||
4 | seems like a better modeling choice for all implementations since it | ||
5 | is covered by the Linux kernel. | ||
6 | 1 | ||
7 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
8 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
9 | Message-Id: <20200819100956.2216690-13-clg@kaod.org> | ||
10 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
11 | --- | ||
12 | hw/net/ftgmac100.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/net/ftgmac100.c | ||
18 | +++ b/hw/net/ftgmac100.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, | ||
20 | if (dma_memory_read(&address_space_memory, bd.des3, ptr, len)) { | ||
21 | qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to read packet @ 0x%x\n", | ||
22 | __func__, bd.des3); | ||
23 | - s->isr |= FTGMAC100_INT_NO_NPTXBUF; | ||
24 | + s->isr |= FTGMAC100_INT_AHB_ERR; | ||
25 | break; | ||
26 | } | ||
27 | |||
28 | -- | ||
29 | 2.25.4 | ||
30 | |||
31 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | According to the Aspeed specs, no interrupts are raised in that case | ||
2 | but a "Tx-packets lost" status seems like a good modeling choice for | ||
3 | all implementations. It is covered by the Linux kernel. | ||
4 | 1 | ||
5 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
6 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
7 | Message-Id: <20200819100956.2216690-14-clg@kaod.org> | ||
8 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
9 | --- | ||
10 | hw/net/ftgmac100.c | 9 +++++++++ | ||
11 | 1 file changed, 9 insertions(+) | ||
12 | |||
13 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/hw/net/ftgmac100.c | ||
16 | +++ b/hw/net/ftgmac100.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, | ||
18 | } | ||
19 | |||
20 | len = FTGMAC100_TXDES0_TXBUF_SIZE(bd.des0); | ||
21 | + if (!len) { | ||
22 | + /* | ||
23 | + * 0 is an invalid size, however the HW does not raise any | ||
24 | + * interrupt. Flag an error because the guest is buggy. | ||
25 | + */ | ||
26 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid segment size\n", | ||
27 | + __func__); | ||
28 | + } | ||
29 | + | ||
30 | if (frame_size + len > sizeof(s->frame)) { | ||
31 | qemu_log_mask(LOG_GUEST_ERROR, "%s: frame too big : %d bytes\n", | ||
32 | __func__, len); | ||
33 | -- | ||
34 | 2.25.4 | ||
35 | |||
36 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | When inserting the VLAN tag in packets, memmove() can generate an | ||
2 | integer overflow for packets whose length is less than 12 bytes. | ||
3 | 1 | ||
4 | Move the VLAN insertion when the last segment of the frame is reached | ||
5 | and check length against the size of the ethernet header (14 bytes) to | ||
6 | avoid the crash. Return FTGMAC100_INT_XPKT_LOST status if the frame is | ||
7 | too small. This seems like a good modeling choice even if Aspeed does | ||
8 | not specify anything in that case. | ||
9 | |||
10 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
11 | Cc: Mauro Matteo Cascella <mcascell@redhat.com> | ||
12 | Reported-by: Ziming Zhang <ezrakiez@gmail.com> | ||
13 | Message-Id: <20200819100956.2216690-15-clg@kaod.org> | ||
14 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
15 | --- | ||
16 | hw/net/ftgmac100.c | 55 ++++++++++++++++++++++++++++++++-------------- | ||
17 | 1 file changed, 39 insertions(+), 16 deletions(-) | ||
18 | |||
19 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/hw/net/ftgmac100.c | ||
22 | +++ b/hw/net/ftgmac100.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static int ftgmac100_write_bd(FTGMAC100Desc *bd, dma_addr_t addr) | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | +static int ftgmac100_insert_vlan(FTGMAC100State *s, int frame_size, | ||
28 | + uint8_t vlan_tci) | ||
29 | +{ | ||
30 | + uint8_t *vlan_hdr = s->frame + (ETH_ALEN * 2); | ||
31 | + uint8_t *payload = vlan_hdr + sizeof(struct vlan_header); | ||
32 | + | ||
33 | + if (frame_size < sizeof(struct eth_header)) { | ||
34 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
35 | + "%s: frame too small for VLAN insertion : %d bytes\n", | ||
36 | + __func__, frame_size); | ||
37 | + s->isr |= FTGMAC100_INT_XPKT_LOST; | ||
38 | + goto out; | ||
39 | + } | ||
40 | + | ||
41 | + if (frame_size + sizeof(struct vlan_header) > sizeof(s->frame)) { | ||
42 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
43 | + "%s: frame too big : %d bytes\n", | ||
44 | + __func__, frame_size); | ||
45 | + s->isr |= FTGMAC100_INT_XPKT_LOST; | ||
46 | + frame_size -= sizeof(struct vlan_header); | ||
47 | + } | ||
48 | + | ||
49 | + memmove(payload, vlan_hdr, frame_size - (ETH_ALEN * 2)); | ||
50 | + stw_be_p(vlan_hdr, ETH_P_VLAN); | ||
51 | + stw_be_p(vlan_hdr + 2, vlan_tci); | ||
52 | + frame_size += sizeof(struct vlan_header); | ||
53 | + | ||
54 | +out: | ||
55 | + return frame_size; | ||
56 | +} | ||
57 | + | ||
58 | static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, | ||
59 | uint32_t tx_descriptor) | ||
60 | { | ||
61 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, | ||
62 | break; | ||
63 | } | ||
64 | |||
65 | - /* Check for VLAN */ | ||
66 | - if (bd.des0 & FTGMAC100_TXDES0_FTS && | ||
67 | - bd.des1 & FTGMAC100_TXDES1_INS_VLANTAG && | ||
68 | - be16_to_cpu(PKT_GET_ETH_HDR(ptr)->h_proto) != ETH_P_VLAN) { | ||
69 | - if (frame_size + len + 4 > sizeof(s->frame)) { | ||
70 | - qemu_log_mask(LOG_GUEST_ERROR, "%s: frame too big : %d bytes\n", | ||
71 | - __func__, len); | ||
72 | - s->isr |= FTGMAC100_INT_XPKT_LOST; | ||
73 | - len = sizeof(s->frame) - frame_size - 4; | ||
74 | - } | ||
75 | - memmove(ptr + 16, ptr + 12, len - 12); | ||
76 | - stw_be_p(ptr + 12, ETH_P_VLAN); | ||
77 | - stw_be_p(ptr + 14, bd.des1); | ||
78 | - len += 4; | ||
79 | - } | ||
80 | - | ||
81 | ptr += len; | ||
82 | frame_size += len; | ||
83 | if (bd.des0 & FTGMAC100_TXDES0_LTS) { | ||
84 | + | ||
85 | + /* Check for VLAN */ | ||
86 | + if (flags & FTGMAC100_TXDES1_INS_VLANTAG && | ||
87 | + be16_to_cpu(PKT_GET_ETH_HDR(s->frame)->h_proto) != ETH_P_VLAN) { | ||
88 | + frame_size = ftgmac100_insert_vlan(s, frame_size, | ||
89 | + FTGMAC100_TXDES1_VLANTAG_CI(flags)); | ||
90 | + } | ||
91 | + | ||
92 | if (flags & FTGMAC100_TXDES1_IP_CHKSUM) { | ||
93 | net_checksum_calculate(s->frame, frame_size); | ||
94 | } | ||
95 | -- | ||
96 | 2.25.4 | ||
97 | |||
98 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The software reset of the MAC needs a finer granularity. Some settings | ||
2 | in MACCR are kept. | ||
3 | 1 | ||
4 | Cc: Frederic Konrad <konrad.frederic@yahoo.fr> | ||
5 | Fixes: bd44300d1afc ("net: add FTGMAC100 support") | ||
6 | Message-Id: <20200819100956.2216690-16-clg@kaod.org> | ||
7 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
8 | --- | ||
9 | hw/net/ftgmac100.c | 18 +++++++++++++----- | ||
10 | 1 file changed, 13 insertions(+), 5 deletions(-) | ||
11 | |||
12 | diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/hw/net/ftgmac100.c | ||
15 | +++ b/hw/net/ftgmac100.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static uint32_t ftgmac100_rxpoll(FTGMAC100State *s) | ||
17 | return cnt / div[speed]; | ||
18 | } | ||
19 | |||
20 | -static void ftgmac100_reset(DeviceState *d) | ||
21 | +static void ftgmac100_do_reset(FTGMAC100State *s, bool sw_reset) | ||
22 | { | ||
23 | - FTGMAC100State *s = FTGMAC100(d); | ||
24 | - | ||
25 | /* Reset the FTGMAC100 */ | ||
26 | s->isr = 0; | ||
27 | s->ier = 0; | ||
28 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_reset(DeviceState *d) | ||
29 | s->fear1 = 0; | ||
30 | s->tpafcr = 0xf1; | ||
31 | |||
32 | - s->maccr = 0; | ||
33 | + if (sw_reset) { | ||
34 | + s->maccr &= FTGMAC100_MACCR_GIGA_MODE | FTGMAC100_MACCR_FAST_MODE; | ||
35 | + } else { | ||
36 | + s->maccr = 0; | ||
37 | + } | ||
38 | + | ||
39 | s->phycr = 0; | ||
40 | s->phydata = 0; | ||
41 | s->fcr = 0x400; | ||
42 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_reset(DeviceState *d) | ||
43 | phy_reset(s); | ||
44 | } | ||
45 | |||
46 | +static void ftgmac100_reset(DeviceState *d) | ||
47 | +{ | ||
48 | + ftgmac100_do_reset(FTGMAC100(d), false); | ||
49 | +} | ||
50 | + | ||
51 | static uint64_t ftgmac100_read(void *opaque, hwaddr addr, unsigned size) | ||
52 | { | ||
53 | FTGMAC100State *s = FTGMAC100(opaque); | ||
54 | @@ -XXX,XX +XXX,XX @@ static void ftgmac100_write(void *opaque, hwaddr addr, | ||
55 | case FTGMAC100_MACCR: /* MAC Device control */ | ||
56 | s->maccr = value; | ||
57 | if (value & FTGMAC100_MACCR_SW_RST) { | ||
58 | - ftgmac100_reset(DEVICE(s)); | ||
59 | + ftgmac100_do_reset(s, true); | ||
60 | } | ||
61 | |||
62 | if (ftgmac100_can_receive(qemu_get_queue(s->nic))) { | ||
63 | -- | ||
64 | 2.25.4 | ||
65 | |||
66 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Joel Stanley <joel@jms.id.au> |
---|---|---|---|
2 | 2 | ||
3 | This allows qemu to run the "normal" power on reset boot path through | 3 | Aspeed have released an updated datasheet (v7) containing the silicon id |
4 | u-boot, where the DDR is trained. | 4 | for the AST2600 A2. It looks like this: |
5 | 5 | ||
6 | An enhancement would be to have the SCU bit stick across qemu reboots, | 6 | SCU004 SCU014 |
7 | but be unset on initial boot. | 7 | AST2600-A0 0x05000303 0x05000303 |
8 | AST2600-A1 0x05010303 0x05010303 | ||
9 | AST2600-A2 0x05010303 0x05020303 | ||
10 | AST2620-A1 0x05010203 0x05010203 | ||
11 | AST2620-A2 0x05010203 0x05020203 | ||
8 | 12 | ||
9 | Proper modelling would be to discard all writes to the phy setting regs | 13 | The SCU004 (silicon id 1) value matches SCU014 for A0, but for |
10 | at offset 0x100 - 0x400 and to model the phy status regs at offset | 14 | subsequent revisions it is hard coded to the A1 value. |
11 | 0x400. | ||
12 | 15 | ||
13 | The status regs model would only need to account for offets 0x00, | 16 | Qemu effectively dropped support for the A0 in 7582591ae745 ("aspeed: |
14 | 0x50, 0x68 and 0x7c. | 17 | Support AST2600A1 silicon revision") as the A0 reset table was removed, |
18 | so it makes sense to only support the behaviour of A1 and onwards. | ||
15 | 19 | ||
16 | Signed-off-by: Joel Stanley <joel@jms.id.au> | 20 | Signed-off-by: Joel Stanley <joel@jms.id.au> |
17 | [ clg: checkpatch fixes ] | 21 | Reviewed-by: Cédric Le Goater <clg@kaod.org> |
18 | Message-Id: <20200819100956.2216690-17-clg@kaod.org> | 22 | Message-Id: <20200916082012.776628-1-joel@jms.id.au> |
19 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | 23 | Signed-off-by: Cédric Le Goater <clg@kaod.org> |
20 | --- | 24 | --- |
21 | include/hw/misc/aspeed_sdmc.h | 13 ++++++++++++- | 25 | hw/misc/aspeed_scu.c | 7 ++++++- |
22 | hw/misc/aspeed_scu.c | 2 +- | 26 | 1 file changed, 6 insertions(+), 1 deletion(-) |
23 | hw/misc/aspeed_sdmc.c | 19 +++++++++++++++++-- | ||
24 | 3 files changed, 30 insertions(+), 4 deletions(-) | ||
25 | 27 | ||
26 | diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h | ||
27 | index XXXXXXX..XXXXXXX 100644 | ||
28 | --- a/include/hw/misc/aspeed_sdmc.h | ||
29 | +++ b/include/hw/misc/aspeed_sdmc.h | ||
30 | @@ -XXX,XX +XXX,XX @@ | ||
31 | #define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500" | ||
32 | #define TYPE_ASPEED_2600_SDMC TYPE_ASPEED_SDMC "-ast2600" | ||
33 | |||
34 | -#define ASPEED_SDMC_NR_REGS (0x174 >> 2) | ||
35 | +/* | ||
36 | + * SDMC has 174 documented registers. In addition the u-boot device tree | ||
37 | + * describes the following regions: | ||
38 | + * - PHY status regs at offset 0x400, length 0x200 | ||
39 | + * - PHY setting regs at offset 0x100, length 0x300 | ||
40 | + * | ||
41 | + * There are two sets of MRS (Mode Registers) configuration in ast2600 memory | ||
42 | + * system: one is in the SDRAM MC (memory controller) which is used in run | ||
43 | + * time, and the other is in the DDR-PHY IP which is used during DDR-PHY | ||
44 | + * training. | ||
45 | + */ | ||
46 | +#define ASPEED_SDMC_NR_REGS (0x500 >> 2) | ||
47 | |||
48 | typedef struct AspeedSDMCState { | ||
49 | /*< private >*/ | ||
50 | diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c | 28 | diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c |
51 | index XXXXXXX..XXXXXXX 100644 | 29 | index XXXXXXX..XXXXXXX 100644 |
52 | --- a/hw/misc/aspeed_scu.c | 30 | --- a/hw/misc/aspeed_scu.c |
53 | +++ b/hw/misc/aspeed_scu.c | 31 | +++ b/hw/misc/aspeed_scu.c |
54 | @@ -XXX,XX +XXX,XX @@ static const uint32_t ast2600_a1_resets[ASPEED_AST2600_SCU_NR_REGS] = { | 32 | @@ -XXX,XX +XXX,XX @@ static void aspeed_ast2600_scu_reset(DeviceState *dev) |
55 | [AST2600_SYS_RST_CTRL2] = 0xFFFFFFFC, | 33 | |
56 | [AST2600_CLK_STOP_CTRL] = 0xFFFF7F8A, | 34 | memcpy(s->regs, asc->resets, asc->nr_regs * 4); |
57 | [AST2600_CLK_STOP_CTRL2] = 0xFFF0FFF0, | 35 | |
58 | - [AST2600_SDRAM_HANDSHAKE] = 0x00000040, /* SoC completed DRAM init */ | 36 | - s->regs[AST2600_SILICON_REV] = s->silicon_rev; |
59 | + [AST2600_SDRAM_HANDSHAKE] = 0x00000000, | ||
60 | [AST2600_HPLL_PARAM] = 0x1000405F, | ||
61 | [AST2600_CHIP_ID0] = 0x1234ABCD, | ||
62 | [AST2600_CHIP_ID1] = 0x88884444, | ||
63 | diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/hw/misc/aspeed_sdmc.c | ||
66 | +++ b/hw/misc/aspeed_sdmc.c | ||
67 | @@ -XXX,XX +XXX,XX @@ static uint64_t aspeed_sdmc_read(void *opaque, hwaddr addr, unsigned size) | ||
68 | if (addr >= ARRAY_SIZE(s->regs)) { | ||
69 | qemu_log_mask(LOG_GUEST_ERROR, | ||
70 | "%s: Out-of-bounds read at offset 0x%" HWADDR_PRIx "\n", | ||
71 | - __func__, addr); | ||
72 | + __func__, addr * 4); | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | @@ -XXX,XX +XXX,XX @@ static void aspeed_sdmc_reset(DeviceState *dev) | ||
77 | |||
78 | /* Set ram size bit and defaults values */ | ||
79 | s->regs[R_CONF] = asc->compute_conf(s, 0); | ||
80 | + | ||
81 | + /* | 37 | + /* |
82 | + * PHY status: | 38 | + * A0 reports A0 in _REV, but subsequent revisions report A1 regardless |
83 | + * - set phy status ok (set bit 1) | 39 | + * of actual revision. QEMU and Linux only support A1 onwards so this is |
84 | + * - initial PVT calibration ok (clear bit 3) | 40 | + * sufficient. |
85 | + * - runtime calibration ok (clear bit 5) | ||
86 | + */ | 41 | + */ |
87 | + s->regs[0x100] = BIT(1); | 42 | + s->regs[AST2600_SILICON_REV] = AST2600_A1_SILICON_REV; |
88 | + | 43 | s->regs[AST2600_SILICON_REV2] = s->silicon_rev; |
89 | + /* PHY eye window: set all as passing */ | 44 | s->regs[AST2600_HW_STRAP1] = s->hw_strap1; |
90 | + s->regs[0x100 | (0x68 / 4)] = 0xff; | 45 | s->regs[AST2600_HW_STRAP2] = s->hw_strap2; |
91 | + s->regs[0x100 | (0x7c / 4)] = 0xff; | ||
92 | + s->regs[0x100 | (0x50 / 4)] = 0xfffffff; | ||
93 | } | ||
94 | |||
95 | static void aspeed_sdmc_get_ram_size(Object *obj, Visitor *v, const char *name, | ||
96 | @@ -XXX,XX +XXX,XX @@ static void aspeed_2600_sdmc_write(AspeedSDMCState *s, uint32_t reg, | ||
97 | } | ||
98 | |||
99 | if (reg != R_PROT && s->regs[R_PROT] == PROT_SOFTLOCKED) { | ||
100 | - qemu_log_mask(LOG_GUEST_ERROR, "%s: SDMC is locked!\n", __func__); | ||
101 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
102 | + "%s: SDMC is locked! (write to MCR%02x blocked)\n", | ||
103 | + __func__, reg * 4); | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | -- | 46 | -- |
108 | 2.25.4 | 47 | 2.25.4 |
109 | 48 | ||
110 | 49 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Joel Stanley <joel@jms.id.au> | ||
2 | 1 | ||
3 | A subset of registers are not protected by the lock behaviour, so allow | ||
4 | unconditionally writing to those. | ||
5 | |||
6 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
7 | Message-Id: <20200819100956.2216690-18-clg@kaod.org> | ||
8 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
9 | --- | ||
10 | hw/misc/aspeed_sdmc.c | 27 +++++++++++++++++++++++++++ | ||
11 | 1 file changed, 27 insertions(+) | ||
12 | |||
13 | diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/hw/misc/aspeed_sdmc.c | ||
16 | +++ b/hw/misc/aspeed_sdmc.c | ||
17 | @@ -XXX,XX +XXX,XX @@ | ||
18 | /* Configuration Register */ | ||
19 | #define R_CONF (0x04 / 4) | ||
20 | |||
21 | +/* Interrupt control/status */ | ||
22 | +#define R_ISR (0x50 / 4) | ||
23 | + | ||
24 | /* Control/Status Register #1 (ast2500) */ | ||
25 | #define R_STATUS1 (0x60 / 4) | ||
26 | #define PHY_BUSY_STATE BIT(0) | ||
27 | #define PHY_PLL_LOCK_STATUS BIT(4) | ||
28 | |||
29 | +/* Reserved */ | ||
30 | +#define R_MCR6C (0x6c / 4) | ||
31 | + | ||
32 | #define R_ECC_TEST_CTRL (0x70 / 4) | ||
33 | #define ECC_TEST_FINISHED BIT(12) | ||
34 | #define ECC_TEST_FAIL BIT(13) | ||
35 | |||
36 | +#define R_TEST_START_LEN (0x74 / 4) | ||
37 | +#define R_TEST_FAIL_DQ (0x78 / 4) | ||
38 | +#define R_TEST_INIT_VAL (0x7c / 4) | ||
39 | +#define R_DRAM_SW (0x88 / 4) | ||
40 | +#define R_DRAM_TIME (0x8c / 4) | ||
41 | +#define R_ECC_ERR_INJECT (0xb4 / 4) | ||
42 | + | ||
43 | /* | ||
44 | * Configuration register Ox4 (for Aspeed AST2400 SOC) | ||
45 | * | ||
46 | @@ -XXX,XX +XXX,XX @@ static uint32_t aspeed_2600_sdmc_compute_conf(AspeedSDMCState *s, uint32_t data) | ||
47 | static void aspeed_2600_sdmc_write(AspeedSDMCState *s, uint32_t reg, | ||
48 | uint32_t data) | ||
49 | { | ||
50 | + /* Unprotected registers */ | ||
51 | + switch (reg) { | ||
52 | + case R_ISR: | ||
53 | + case R_MCR6C: | ||
54 | + case R_TEST_START_LEN: | ||
55 | + case R_TEST_FAIL_DQ: | ||
56 | + case R_TEST_INIT_VAL: | ||
57 | + case R_DRAM_SW: | ||
58 | + case R_DRAM_TIME: | ||
59 | + case R_ECC_ERR_INJECT: | ||
60 | + s->regs[reg] = data; | ||
61 | + return; | ||
62 | + } | ||
63 | + | ||
64 | if (s->regs[R_PROT] == PROT_HARDLOCKED) { | ||
65 | qemu_log_mask(LOG_GUEST_ERROR, "%s: SDMC is locked until system reset!\n", | ||
66 | __func__); | ||
67 | -- | ||
68 | 2.25.4 | ||
69 | |||
70 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Changes in commit 533eb415df2e ("arm/aspeed: actually check RAM size") | ||
2 | introduced a 'valid_ram_sizes' array which can be used to compute the | ||
3 | associated bit field value encoding the RAM size. The field is simply | ||
4 | the index of the array. | ||
5 | 1 | ||
6 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
7 | Message-Id: <20200819100956.2216690-19-clg@kaod.org> | ||
8 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
9 | --- | ||
10 | hw/misc/aspeed_sdmc.c | 79 ++++++++++++++----------------------------- | ||
11 | 1 file changed, 25 insertions(+), 54 deletions(-) | ||
12 | |||
13 | diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/hw/misc/aspeed_sdmc.c | ||
16 | +++ b/hw/misc/aspeed_sdmc.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_sdmc_ops = { | ||
18 | .valid.max_access_size = 4, | ||
19 | }; | ||
20 | |||
21 | -static int ast2400_rambits(AspeedSDMCState *s) | ||
22 | -{ | ||
23 | - switch (s->ram_size >> 20) { | ||
24 | - case 64: | ||
25 | - return ASPEED_SDMC_DRAM_64MB; | ||
26 | - case 128: | ||
27 | - return ASPEED_SDMC_DRAM_128MB; | ||
28 | - case 256: | ||
29 | - return ASPEED_SDMC_DRAM_256MB; | ||
30 | - case 512: | ||
31 | - return ASPEED_SDMC_DRAM_512MB; | ||
32 | - default: | ||
33 | - g_assert_not_reached(); | ||
34 | - break; | ||
35 | - } | ||
36 | -} | ||
37 | - | ||
38 | -static int ast2500_rambits(AspeedSDMCState *s) | ||
39 | -{ | ||
40 | - switch (s->ram_size >> 20) { | ||
41 | - case 128: | ||
42 | - return ASPEED_SDMC_AST2500_128MB; | ||
43 | - case 256: | ||
44 | - return ASPEED_SDMC_AST2500_256MB; | ||
45 | - case 512: | ||
46 | - return ASPEED_SDMC_AST2500_512MB; | ||
47 | - case 1024: | ||
48 | - return ASPEED_SDMC_AST2500_1024MB; | ||
49 | - default: | ||
50 | - g_assert_not_reached(); | ||
51 | - break; | ||
52 | - } | ||
53 | -} | ||
54 | - | ||
55 | -static int ast2600_rambits(AspeedSDMCState *s) | ||
56 | -{ | ||
57 | - switch (s->ram_size >> 20) { | ||
58 | - case 256: | ||
59 | - return ASPEED_SDMC_AST2600_256MB; | ||
60 | - case 512: | ||
61 | - return ASPEED_SDMC_AST2600_512MB; | ||
62 | - case 1024: | ||
63 | - return ASPEED_SDMC_AST2600_1024MB; | ||
64 | - case 2048: | ||
65 | - return ASPEED_SDMC_AST2600_2048MB; | ||
66 | - default: | ||
67 | - g_assert_not_reached(); | ||
68 | - break; | ||
69 | - } | ||
70 | -} | ||
71 | - | ||
72 | static void aspeed_sdmc_reset(DeviceState *dev) | ||
73 | { | ||
74 | AspeedSDMCState *s = ASPEED_SDMC(dev); | ||
75 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_sdmc_info = { | ||
76 | .abstract = true, | ||
77 | }; | ||
78 | |||
79 | +static int aspeed_sdmc_get_ram_bits(AspeedSDMCState *s) | ||
80 | +{ | ||
81 | + AspeedSDMCClass *asc = ASPEED_SDMC_GET_CLASS(s); | ||
82 | + int i; | ||
83 | + | ||
84 | + /* | ||
85 | + * The bitfield value encoding the RAM size is the index of the | ||
86 | + * possible RAM size array | ||
87 | + */ | ||
88 | + for (i = 0; asc->valid_ram_sizes[i]; i++) { | ||
89 | + if (s->ram_size == asc->valid_ram_sizes[i]) { | ||
90 | + return i; | ||
91 | + } | ||
92 | + } | ||
93 | + | ||
94 | + /* | ||
95 | + * Invalid RAM sizes should have been excluded when setting the | ||
96 | + * SoC RAM size. | ||
97 | + */ | ||
98 | + g_assert_not_reached(); | ||
99 | +} | ||
100 | + | ||
101 | static uint32_t aspeed_2400_sdmc_compute_conf(AspeedSDMCState *s, uint32_t data) | ||
102 | { | ||
103 | uint32_t fixed_conf = ASPEED_SDMC_VGA_COMPAT | | ||
104 | - ASPEED_SDMC_DRAM_SIZE(ast2400_rambits(s)); | ||
105 | + ASPEED_SDMC_DRAM_SIZE(aspeed_sdmc_get_ram_bits(s)); | ||
106 | |||
107 | /* Make sure readonly bits are kept */ | ||
108 | data &= ~ASPEED_SDMC_READONLY_MASK; | ||
109 | @@ -XXX,XX +XXX,XX @@ static uint32_t aspeed_2500_sdmc_compute_conf(AspeedSDMCState *s, uint32_t data) | ||
110 | uint32_t fixed_conf = ASPEED_SDMC_HW_VERSION(1) | | ||
111 | ASPEED_SDMC_VGA_APERTURE(ASPEED_SDMC_VGA_64MB) | | ||
112 | ASPEED_SDMC_CACHE_INITIAL_DONE | | ||
113 | - ASPEED_SDMC_DRAM_SIZE(ast2500_rambits(s)); | ||
114 | + ASPEED_SDMC_DRAM_SIZE(aspeed_sdmc_get_ram_bits(s)); | ||
115 | |||
116 | /* Make sure readonly bits are kept */ | ||
117 | data &= ~ASPEED_SDMC_AST2500_READONLY_MASK; | ||
118 | @@ -XXX,XX +XXX,XX @@ static uint32_t aspeed_2600_sdmc_compute_conf(AspeedSDMCState *s, uint32_t data) | ||
119 | { | ||
120 | uint32_t fixed_conf = ASPEED_SDMC_HW_VERSION(3) | | ||
121 | ASPEED_SDMC_VGA_APERTURE(ASPEED_SDMC_VGA_64MB) | | ||
122 | - ASPEED_SDMC_DRAM_SIZE(ast2600_rambits(s)); | ||
123 | + ASPEED_SDMC_DRAM_SIZE(aspeed_sdmc_get_ram_bits(s)); | ||
124 | |||
125 | /* Make sure readonly bits are kept (use ast2500 mask) */ | ||
126 | data &= ~ASPEED_SDMC_AST2500_READONLY_MASK; | ||
127 | -- | ||
128 | 2.25.4 | ||
129 | |||
130 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | This change works around the HW default values to be able to test the | ||
2 | Tacoma board with -kernel command line option. This was required when | ||
3 | we had both flash chips enabled in the device tree, otherwise Linux | ||
4 | would fail to probe the entire controller leaving it with no rootfs. | ||
5 | 1 | ||
6 | Reviewed-by: Joel Stanley <joel@jms.id.au> | ||
7 | Message-Id: <20200819100956.2216690-20-clg@kaod.org> | ||
8 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
9 | --- | ||
10 | hw/ssi/aspeed_smc.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/hw/ssi/aspeed_smc.c | ||
16 | +++ b/hw/ssi/aspeed_smc.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static void aspeed_smc_reg_to_segment(const AspeedSMCState *s, uint32_t reg, | ||
18 | |||
19 | static const AspeedSegments aspeed_segments_ast2600_fmc[] = { | ||
20 | { 0x0, 128 * MiB }, /* start address is readonly */ | ||
21 | - { 0x0, 0 }, /* disabled */ | ||
22 | + { 128 * MiB, 128 * MiB }, /* default is disabled but needed for -kernel */ | ||
23 | { 0x0, 0 }, /* disabled */ | ||
24 | }; | ||
25 | |||
26 | -- | ||
27 | 2.25.4 | ||
28 | |||
29 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Igor Kononenko <i.kononenko@yadro.com> | ||
2 | 1 | ||
3 | Provide a definition for the "25Hz reference clock input mode" strap | ||
4 | |||
5 | Signed-off-by: Igor Kononenko <i.kononenko@yadro.com> | ||
6 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
7 | Message-Id: <20200811203502.20382-1-i.kononenko@yadro.com> | ||
8 | Message-Id: <20200819100956.2216690-21-clg@kaod.org> | ||
9 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
10 | --- | ||
11 | include/hw/misc/aspeed_scu.h | 1 + | ||
12 | 1 file changed, 1 insertion(+) | ||
13 | |||
14 | diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/include/hw/misc/aspeed_scu.h | ||
17 | +++ b/include/hw/misc/aspeed_scu.h | ||
18 | @@ -XXX,XX +XXX,XX @@ uint32_t aspeed_scu_get_apb_freq(AspeedSCUState *s); | ||
19 | #define SCU_AST2500_HW_STRAP_ESPI_FLASH_ENABLE (0x1 << 26) | ||
20 | #define SCU_AST2500_HW_STRAP_ESPI_ENABLE (0x1 << 25) | ||
21 | #define SCU_AST2500_HW_STRAP_DDR4_ENABLE (0x1 << 24) | ||
22 | +#define SCU_AST2500_HW_STRAP_25HZ_CLOCK_MODE (0x1 << 23) | ||
23 | |||
24 | #define SCU_AST2500_HW_STRAP_ACPI_ENABLE (0x1 << 19) | ||
25 | #define SCU_AST2500_HW_STRAP_USBCKI_FREQ (0x1 << 18) | ||
26 | -- | ||
27 | 2.25.4 | ||
28 | |||
29 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Igor Kononenko <i.kononenko@yadro.com> | ||
2 | 1 | ||
3 | Support a following SPI flashes: | ||
4 | * mx66l51235f | ||
5 | * mt25ql512ab | ||
6 | |||
7 | Signed-off-by: Igor Kononenko <i.kononenko@yadro.com> | ||
8 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
9 | Message-Id: <20200811203724.20699-1-i.kononenko@yadro.com> | ||
10 | Message-Id: <20200819100956.2216690-22-clg@kaod.org> | ||
11 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
12 | --- | ||
13 | hw/block/m25p80.c | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/hw/block/m25p80.c | ||
19 | +++ b/hw/block/m25p80.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static const FlashPartInfo known_devices[] = { | ||
21 | { INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) }, | ||
22 | { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512, 0) }, | ||
23 | { INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) }, | ||
24 | + { INFO("mx66l51235f", 0xc2201a, 0, 64 << 10, 1024, ER_4K | ER_32K) }, | ||
25 | { INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) }, | ||
26 | { INFO("mx66u1g45g", 0xc2253b, 0, 64 << 10, 2048, ER_4K | ER_32K) }, | ||
27 | { INFO("mx66l1g45g", 0xc2201b, 0, 64 << 10, 2048, ER_4K | ER_32K) }, | ||
28 | @@ -XXX,XX +XXX,XX @@ static const FlashPartInfo known_devices[] = { | ||
29 | { INFO("n25q256a", 0x20ba19, 0, 64 << 10, 512, ER_4K) }, | ||
30 | { INFO("n25q512a", 0x20ba20, 0, 64 << 10, 1024, ER_4K) }, | ||
31 | { INFO("n25q512ax3", 0x20ba20, 0x1000, 64 << 10, 1024, ER_4K) }, | ||
32 | + { INFO("mt25ql512ab", 0x20ba20, 0x1044, 64 << 10, 1024, ER_4K | ER_32K) }, | ||
33 | { INFO_STACKED("n25q00", 0x20ba21, 0x1000, 64 << 10, 2048, ER_4K, 4) }, | ||
34 | { INFO_STACKED("n25q00a", 0x20bb21, 0x1000, 64 << 10, 2048, ER_4K, 4) }, | ||
35 | { INFO_STACKED("mt25ql01g", 0x20ba21, 0x1040, 64 << 10, 2048, ER_4K, 2) }, | ||
36 | -- | ||
37 | 2.25.4 | ||
38 | |||
39 | diff view generated by jsdifflib |