qemu/include/hw/timer
Jamin Lin 8bc691bed8 hw/timer/aspeed: Add AST2700 Support
The timer controller include 8 sets of 32-bit decrement counters, based on
either PCLK or 1MHZ clock and the design of timer controller between AST2600
and AST2700 are almost the same.

TIMER0 – TIMER7 has their own individual control and interrupt status register.
In other words, users are able to set timer control in register TMC10 with
different TIMER base address and clear timer control and interrupt status in
register TMC14 with different TIMER base address.

Introduce new "aspeed_2700_timer_read" and "aspeed_2700_timer_write" callback
functions and a new ast2700 class to support AST2700.

The base address of TIMER0 to TIMER7 as following.
Base Address of Timer 0 = 0x12C1_0000
Base Address of Timer 1 = 0x12C1_0040
Base Address of Timer 2 = 0x12C1_0080
Base Address of Timer 3 = 0x12C1_00C0
Base Address of Timer 4 = 0x12C1_0100
Base Address of Timer 5 = 0x12C1_0140
Base Address of Timer 6 = 0x12C1_0180
Base Address of Timer 7 = 0x12C1_01C0

The register address space of each TIMER is "0x40" , and uses the following
formula to get the index and register of each TIMER.

timer_index = offset >> 6;
timer_offset = offset & 0x3f;

The TMC010 is a counter control set and interrupt status register. Write "1" to
TMC10[3:0] will set the specific bits to "1". Introduce a new
"aspeed_2700_timer_set_ctrl" function to handle this register behavior.

The TMC014 is a counter control clear and interrupt status register, to clear
the specific bits to "0", it should write "1" to  TMC14[3:0] on the same bit
position. Introduce a new "aspeed_2700_timer_clear_ctrl" function to handle
this register behavior. TMC014 does not support read operation.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Acked-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/r/20250113064455.1660564-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-01-27 09:38:15 +01:00
..
a9gtimer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
allwinner-a10-pit.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
arm_mptimer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
armv7m_systick.h arm: Remove system_clock_scale global 2021-09-01 11:08:21 +01:00
aspeed_timer.h hw/timer/aspeed: Add AST2700 Support 2025-01-27 09:38:15 +01:00
avr_timer16.h hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
bcm2835_systmr.h Clean up header guards that don't match their file name 2022-05-11 16:49:06 +02:00
cadence_ttc.h timer: cadence_ttc: Break out header file to allow embedding 2022-04-21 11:37:03 +01:00
cmsdk-apb-dualtimer.h arm: Remove frq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
cmsdk-apb-timer.h hw/timer/cmsdk-apb-timer: Remove unused 'qdev-properties.h' header 2023-02-27 13:27:05 +00:00
digic-timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
grlib_gptimer.h hw/sparc/grlib: split out the headers for each peripherals 2024-02-15 16:58:46 +01:00
hpet.h hw/timer/hpet: Drop the unused macro 2024-12-28 14:42:52 +03:00
i8254.h hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available 2023-02-27 22:29:02 +01:00
i8254_internal.h hw/isa: Remove empty ISADeviceClass structure 2023-02-27 22:29:01 +01:00
ibex_timer.h hw/intc: Move mtimer/mtimecmp to aclint 2022-09-07 09:19:10 +02:00
imx_epit.h hw/timer/imx_epit: remove explicit fields cnt and freq 2023-01-05 12:14:43 +00:00
imx_gpt.h i.MX6UL: Add a specific GPT timer instance for the i.MX6UL 2023-01-05 15:02:08 +00:00
mips_gictimer.h hw/mips_gictimer: provide API for retrieving frequency 2017-02-21 22:24:58 +00:00
mss-timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
npcm7xx_timer.h hw/timer: Refactor NPCM7XX Timer to use CLK clock 2021-01-12 21:19:02 +00:00
nrf51_timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
renesas_cmt.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
renesas_tmr.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
sifive_pwm.h hw/timer: Add SiFive PWM support 2021-09-21 07:56:49 +10:00
sse-counter.h hw/timer/sse-counter: Model the SSE Subsystem System Counter 2021-03-08 17:20:01 +00:00
sse-timer.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
stellaris-gptm.h hw/timer/stellaris-gptm: Use Clock input instead of system_clock_scale 2021-09-01 11:08:20 +01:00
stm32f2xx_timer.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
tmu012.h hw/sh4: Extract timer definitions to 'hw/timer/tmu012.h' 2020-06-22 18:37:12 +02:00