1*04a7c7b1SInès Varhol /* 2*04a7c7b1SInès Varhol * STM32L4x5 SoC family 3*04a7c7b1SInès Varhol * 4*04a7c7b1SInès Varhol * Copyright (c) 2023 Arnaud Minier <arnaud.minier@telecom-paris.fr> 5*04a7c7b1SInès Varhol * Copyright (c) 2023 Inès Varhol <ines.varhol@telecom-paris.fr> 6*04a7c7b1SInès Varhol * 7*04a7c7b1SInès Varhol * SPDX-License-Identifier: GPL-2.0-or-later 8*04a7c7b1SInès Varhol * 9*04a7c7b1SInès Varhol * This work is licensed under the terms of the GNU GPL, version 2 or later. 10*04a7c7b1SInès Varhol * See the COPYING file in the top-level directory. 11*04a7c7b1SInès Varhol * 12*04a7c7b1SInès Varhol * This work is heavily inspired by the stm32f405_soc by Alistair Francis. 13*04a7c7b1SInès Varhol * Original code is licensed under the MIT License: 14*04a7c7b1SInès Varhol * 15*04a7c7b1SInès Varhol * Copyright (c) 2014 Alistair Francis <alistair@alistair23.me> 16*04a7c7b1SInès Varhol */ 17*04a7c7b1SInès Varhol 18*04a7c7b1SInès Varhol /* 19*04a7c7b1SInès Varhol * The reference used is the STMicroElectronics RM0351 Reference manual 20*04a7c7b1SInès Varhol * for STM32L4x5 and STM32L4x6 advanced Arm ® -based 32-bit MCUs. 21*04a7c7b1SInès Varhol * https://www.st.com/en/microcontrollers-microprocessors/stm32l4x5/documentation.html 22*04a7c7b1SInès Varhol */ 23*04a7c7b1SInès Varhol 24*04a7c7b1SInès Varhol #ifndef HW_ARM_STM32L4x5_SOC_H 25*04a7c7b1SInès Varhol #define HW_ARM_STM32L4x5_SOC_H 26*04a7c7b1SInès Varhol 27*04a7c7b1SInès Varhol #include "exec/memory.h" 28*04a7c7b1SInès Varhol #include "hw/arm/armv7m.h" 29*04a7c7b1SInès Varhol #include "qom/object.h" 30*04a7c7b1SInès Varhol 31*04a7c7b1SInès Varhol #define TYPE_STM32L4X5_SOC "stm32l4x5-soc" 32*04a7c7b1SInès Varhol #define TYPE_STM32L4X5XC_SOC "stm32l4x5xc-soc" 33*04a7c7b1SInès Varhol #define TYPE_STM32L4X5XE_SOC "stm32l4x5xe-soc" 34*04a7c7b1SInès Varhol #define TYPE_STM32L4X5XG_SOC "stm32l4x5xg-soc" 35*04a7c7b1SInès Varhol OBJECT_DECLARE_TYPE(Stm32l4x5SocState, Stm32l4x5SocClass, STM32L4X5_SOC) 36*04a7c7b1SInès Varhol 37*04a7c7b1SInès Varhol struct Stm32l4x5SocState { 38*04a7c7b1SInès Varhol SysBusDevice parent_obj; 39*04a7c7b1SInès Varhol 40*04a7c7b1SInès Varhol ARMv7MState armv7m; 41*04a7c7b1SInès Varhol 42*04a7c7b1SInès Varhol MemoryRegion sram1; 43*04a7c7b1SInès Varhol MemoryRegion sram2; 44*04a7c7b1SInès Varhol MemoryRegion flash; 45*04a7c7b1SInès Varhol MemoryRegion flash_alias; 46*04a7c7b1SInès Varhol 47*04a7c7b1SInès Varhol Clock *sysclk; 48*04a7c7b1SInès Varhol Clock *refclk; 49*04a7c7b1SInès Varhol }; 50*04a7c7b1SInès Varhol 51*04a7c7b1SInès Varhol struct Stm32l4x5SocClass { 52*04a7c7b1SInès Varhol SysBusDeviceClass parent_class; 53*04a7c7b1SInès Varhol 54*04a7c7b1SInès Varhol size_t flash_size; 55*04a7c7b1SInès Varhol }; 56*04a7c7b1SInès Varhol 57*04a7c7b1SInès Varhol #endif 58