All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: "Cédric Le Goater" <clg@kaod.org>, openbmc@lists.ozlabs.org
Subject: Re: [PATCH qemu 06/38] aspeed: add a memory region for SRAM
Date: Mon, 21 Nov 2016 22:51:13 +1030	[thread overview]
Message-ID: <1479730873.5215.33.camel@aj.id.au> (raw)
In-Reply-To: <1479478938-13267-7-git-send-email-clg@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 4883 bytes --]

On Fri, 2016-11-18 at 15:21 +0100, Cédric Le Goater wrote:
> The size of the SRAM depends on the SoC model, so use a per-soc
> definition when creating the region.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  hw/arm/aspeed_soc.c         | 52 +++++++++++++++++++++++++++++++++++++--------
>  include/hw/arm/aspeed_soc.h |  2 ++
>  2 files changed, 45 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index bbbbfd13862c..387b712d8fd5 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -29,6 +29,7 @@
>  #define ASPEED_SOC_VIC_BASE         0x1E6C0000
>  #define ASPEED_SOC_SDMC_BASE        0x1E6E0000
>  #define ASPEED_SOC_SCU_BASE         0x1E6E2000
> +#define ASPEED_SOC_SRAM_BASE        0x1E720000
>  #define ASPEED_SOC_TIMER_BASE       0x1E782000
>  #define ASPEED_SOC_I2C_BASE         0x1E78A000
>  
> @@ -47,15 +48,37 @@ static const char *aspeed_soc_ast2500_typenames[] = {
>      "aspeed.smc.ast2500-spi1", "aspeed.smc.ast2500-spi2" };
>  
>  static const AspeedSoCInfo aspeed_socs[] = {
> -    { "ast2400-a0", "arm926", AST2400_A0_SILICON_REV, AST2400_SDRAM_BASE,
> -      1, aspeed_soc_ast2400_spi_bases,
> -      "aspeed.smc.fmc", aspeed_soc_ast2400_typenames },
> -    { "ast2400",    "arm926", AST2400_A0_SILICON_REV, AST2400_SDRAM_BASE,
> -      1, aspeed_soc_ast2400_spi_bases,
> -     "aspeed.smc.fmc", aspeed_soc_ast2400_typenames },
> -    { "ast2500-a1", "arm1176", AST2500_A1_SILICON_REV, AST2500_SDRAM_BASE,
> -      2, aspeed_soc_ast2500_spi_bases,
> -      "aspeed.smc.ast2500-fmc", aspeed_soc_ast2500_typenames },
> +    {
> +        .name         = "ast2400-a0",
> +        .cpu_model    = "arm926",
> +        .silicon_rev  = AST2400_A0_SILICON_REV,
> +        .sdram_base   = AST2400_SDRAM_BASE,
> +        .sram_size    = 0x8000,
> +        .spis_num     = 1,
> +        .spi_bases    = aspeed_soc_ast2400_spi_bases,
> +        .fmc_typename = "aspeed.smc.fmc",
> +        .spi_typename = aspeed_soc_ast2400_typenames,
> +    }, {
> +        .name         = "ast2400",
> +        .cpu_model    = "arm926",
> +        .silicon_rev  = AST2400_A0_SILICON_REV,
> +        .sdram_base   = AST2400_SDRAM_BASE,
> +        .sram_size    = 0x8000,
> +        .spis_num     = 1,
> +        .spi_bases    = aspeed_soc_ast2400_spi_bases,
> +        .fmc_typename = "aspeed.smc.fmc",
> +        .spi_typename = aspeed_soc_ast2400_typenames,
> +    }, {
> +        .name         = "ast2500-a1",
> +        .cpu_model    = "arm1176",
> +        .silicon_rev  = AST2500_A1_SILICON_REV,
> +        .sdram_base   = AST2500_SDRAM_BASE,
> +        .sram_size    = 0x9000,
> +        .spis_num     = 2,
> +        .spi_bases    = aspeed_soc_ast2500_spi_bases,
> +        .fmc_typename = "aspeed.smc.ast2500-fmc",
> +        .spi_typename = aspeed_soc_ast2500_typenames,
> +    },
>  };
>  
>  /*
> @@ -157,6 +180,17 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
>          return;
>      }
>  
> +    /* SRAM */
> +    memory_region_init_ram(&s->sram, OBJECT(dev), "aspeed.sram",
> +                           sc->info->sram_size, &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
> +    vmstate_register_ram_global(&s->sram);
> +    memory_region_add_subregion(get_system_memory(), ASPEED_SOC_SRAM_BASE,
> +                                &s->sram);
> +
>      /* VIC */
>      object_property_set_bool(OBJECT(&s->vic), true, "realized", &err);
>      if (err) {
> diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
> index 6f1b679c97b1..1ab5deaa0813 100644
> --- a/include/hw/arm/aspeed_soc.h
> +++ b/include/hw/arm/aspeed_soc.h
> @@ -29,6 +29,7 @@ typedef struct AspeedSoCState {
>      /*< public >*/
>      ARMCPU cpu;
>      MemoryRegion iomem;
> +    MemoryRegion sram;
>      AspeedVICState vic;
>      AspeedTimerCtrlState timerctrl;
>      AspeedI2CState i2c;
> @@ -46,6 +47,7 @@ typedef struct AspeedSoCInfo {
>      const char *cpu_model;
>      uint32_t silicon_rev;
>      hwaddr sdram_base;
> +    uint64_t sram_size;
>      int spis_num;
>      const hwaddr *spi_bases;
>      const char *fmc_typename;

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2016-11-21 12:21 UTC|newest]

Thread overview: 142+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 14:21 [PATCH qemu 00/38] aspeed: going mainline Cédric Le Goater
2016-11-18 14:21 ` [PATCH qemu 01/38] m25p80: add support for the mx66l1g45g Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 10:31   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 02/38] aspeed: QOMify the CPU object and attach it to the SoC Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 10:59   ` Andrew Jeffery
2016-11-21 14:14     ` Cédric Le Goater
2016-11-18 14:21 ` [PATCH qemu 03/38] aspeed: attach the second SPI controller object " Cédric Le Goater
2016-11-21 11:03   ` Andrew Jeffery
2016-11-21 11:42     ` Joel Stanley
2016-11-21 11:57       ` Andrew Jeffery
2016-11-21 13:14         ` Cédric Le Goater
2016-11-18 14:21 ` [PATCH qemu 04/38] aspeed: extend the board configuration with flash models Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21 11:07   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 05/38] aspeed: add support for the romulus-bmc board Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 12:18   ` Andrew Jeffery
2016-11-21 14:44     ` Cédric Le Goater
2016-11-22  3:06       ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 06/38] aspeed: add a memory region for SRAM Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 12:21   ` Andrew Jeffery [this message]
2016-11-18 14:21 ` [PATCH qemu 07/38] aspeed: add the definitions for the AST2400 A1 SoC Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21 12:50   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 08/38] aspeed: change SoC revision of the palmetto-bmc machine Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21 13:16   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 09/38] aspeed/scu: fix SCU region size Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21  9:44     ` Cédric Le Goater
2016-11-21 12:54   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 10/38] aspeed/smc: improve segment register support Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-18 14:21 ` [PATCH qemu 11/38] aspeed/smc: get the number of flash modules from hw strapping Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21  9:59     ` Cédric Le Goater
2016-11-21 10:05       ` Joel Stanley
2016-11-21 13:13   ` Andrew Jeffery
2016-11-21 13:29     ` Cédric Le Goater
2016-11-21 13:35       ` Andrew Jeffery
2016-11-21 13:47         ` Cédric Le Goater
2016-11-22  3:10           ` Andrew Jeffery
2016-11-22  7:21             ` Cédric Le Goater
2016-11-23  1:22               ` Andrew Jeffery
2016-11-23  9:33                 ` Cédric Le Goater
2016-11-23 19:08                   ` Cédric Le Goater
2016-11-24  1:00                     ` Andrew Jeffery
2016-11-24  6:31                       ` Cédric Le Goater
2016-11-18 14:21 ` [PATCH qemu 12/38] aspeed/smc: rework the prototype of the AspeedSMCFlash helper routines Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 13:20   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 13/38] aspeed/smc: introduce a aspeed_smc_flash_update_cs() helper Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21 10:02     ` Cédric Le Goater
2016-11-21 13:36   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 14/38] aspeed/smc: autostrap CE0/1 configuration Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-25  3:07   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 15/38] aspeed/smc: handle SPI flash Command mode Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-25  4:23   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 16/38] aspeed/smc: add tests for " Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 10:32     ` Cédric Le Goater
2016-11-25  4:30   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 17/38] aspeed/smc: unfold the AspeedSMCController array Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-25  4:31   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 18/38] aspeed/smc: add a 'sdram_base' property Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-25  4:35   ` Andrew Jeffery
2016-11-18 14:21 ` [PATCH qemu 19/38] aspeed/smc: add support for DMAs Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 11:07     ` Cédric Le Goater
2016-11-21 11:24       ` Joel Stanley
2016-11-18 14:22 ` [PATCH qemu 20/38] aspeed/smc: handle dummy bytes when doing fast reads Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-21 12:50     ` Cédric Le Goater
2016-11-28  1:35   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 21/38] aspeed/smc: adjust the size of the register region Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-28  1:44   ` Andrew Jeffery
2016-11-28  7:24     ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 22/38] aspeed: use first SPI flash as a boot ROM Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-28  1:47   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 23/38] block: add a model option for MTD devices Cédric Le Goater
2016-11-21  7:27   ` Joel Stanley
2016-11-21 10:31     ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 24/38] aspeed/smc: use flash model option Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-18 14:22 ` [PATCH qemu 25/38] aspeed/sdmc: rework the locking register of the memory controller Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-28  1:55   ` Andrew Jeffery
2016-11-28 12:34     ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 26/38] aspeed/sdmc: fake a few more registers to let DRAM calibration run Cédric Le Goater
2016-11-21  7:25   ` Joel Stanley
2016-11-28  2:02   ` Andrew Jeffery
2016-11-28 12:38     ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 27/38] hw/misc: add a TMP42{1,2,3} device model Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-18 14:22 ` [PATCH qemu 28/38] aspeed: add a temp sensor device on I2C bus 3 Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-22 16:57   ` Cédric Le Goater
2016-11-28  2:04     ` Andrew Jeffery
2016-11-28  9:51       ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 29/38] aspeed: add a rtc device on I2C bus 0 Cédric Le Goater
2016-11-21  7:27   ` Joel Stanley
2016-11-22 17:00   ` Cédric Le Goater
2016-11-28  2:05   ` Andrew Jeffery
2016-11-28  2:09     ` Andrew Jeffery
2016-11-28  9:52       ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 30/38] wdt: Add Aspeed watchdog device model Cédric Le Goater
2016-11-21 13:03   ` Cédric Le Goater
2016-11-21 13:23     ` Joel Stanley
2016-11-28  2:11     ` Andrew Jeffery
2016-11-28  9:58       ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 31/38] aspeed: add a watchdog controller Cédric Le Goater
2016-11-21  7:27   ` Joel Stanley
2016-11-21 12:53     ` Cédric Le Goater
2016-11-28  2:12   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 32/38] wdt: aspeed: Fix failed reboot due to timer miscalculation Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-18 14:22 ` [PATCH qemu 33/38] wdt: aspeed: use scu to get clock freq Cédric Le Goater
2016-11-21  7:27   ` Joel Stanley
2016-11-18 14:22 ` [PATCH qemu 34/38] net: add FTGMAC100 support Cédric Le Goater
2016-11-28  2:13   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 35/38] net/ftgmac100: add a 'aspeed' property Cédric Le Goater
2016-11-28  2:22   ` Andrew Jeffery
2016-11-28 11:20     ` Cédric Le Goater
2016-11-18 14:22 ` [PATCH qemu 36/38] ast2400: add a FTGMAC100 nic Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-28  2:25   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 37/38] slirp: add a fake NCSI backend Cédric Le Goater
2016-11-21  7:26   ` Joel Stanley
2016-11-21 13:04     ` Cédric Le Goater
2016-11-28  2:26   ` Andrew Jeffery
2016-11-18 14:22 ` [PATCH qemu 38/38] target-arm: Add VBAR support to ARM1176 CPUs Cédric Le Goater
2016-11-21  7:27   ` Joel Stanley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479730873.5215.33.camel@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.