platform: andes/ae350: Implement hart hotplug using HSM extension
authorYu Chien Peter Lin <peterlin@andestech.com>
Fri, 20 Jan 2023 03:05:11 +0000 (11:05 +0800)
committerAnup Patel <anup@brainfault.org>
Sun, 22 Jan 2023 12:03:03 +0000 (17:33 +0530)
commit787296ae92b7ec5363dab71b6d036e8def31c6f7
treed7d13ea7fda379ea99cc72cf4b52c95447c91a15
parent9c4eb3521e515603671198295f2c7d5114e4c601
platform: andes/ae350: Implement hart hotplug using HSM extension

Add hart_start() and hart_stop() callbacks for the multi-core ae350
platform, it utilizes the ATCSMU to put the harts into power-gated
deep sleep mode. The programming sequence is stated as below:

1. Set the wakeup events to PCSm_WE
2. Set the sleep command to PCSm_CTL
3. Set the reset vector to HARTm_RESET_VECTOR_{LO|HI}
4. Write back and invalidate D-cache by executing the CCTL command L1D_WBINVAL_ALL
5. Disable I/D-cache by clearing mcache_ctl.{I|D}C_EN
6. Disable D-cache coherency by clearing mcache_ctl_.DC_COHEN
7. Wait for mcache_ctl.DC_COHSTA to be cleared to ensure the previous step is completed
8. Execute WFI

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
platform/generic/andes/ae350.c
platform/generic/andes/objects.mk
platform/generic/andes/sleep.S [new file with mode: 0644]
platform/generic/include/andes/andes45.h [new file with mode: 0644]