All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v4 0/2] arch: riscv: cpu: Add callback to init each core
@ 2021-03-30  5:26 Green Wan
  2021-03-30  5:26 ` [RFC PATCH v4 1/2] " Green Wan
  2021-03-30  5:26 ` [RFC PATCH v4 2/2] board: sifive: unmatched: clear feature disable CSR Green Wan
  0 siblings, 2 replies; 22+ messages in thread
From: Green Wan @ 2021-03-30  5:26 UTC (permalink / raw)
  To: u-boot

Add a callback interface, riscv_hart_early_init() to perform riscv CPU 
hart-dependent configuration for each hart. riscv_hart_early_init() is
placed after stack of harts are initialized and before main boot hart is
picked up. Several conditions should be aware of or avoided are listed:

  - cannot access gd
    At the moment, gd hasn't initialized yet.

  - all operations in riscv_hart_early_init() should only affect core itself
    For example, the operations for board level should be moved to mach_xxx()
    or board_init_xxx() functions instead.

  - Common resource need protection if multicore
    Since all harts might enter riscv_hart_early_init() in parallel, common
    resource need a mechanism to handle race condition.

  - A dummy implementation is added in ./arch/riscv/cpu/cpu.c
    The implementation is declared with '__weak' and can be overridden.

Changelogs:
v4
  - Revising the comments for riscv_hart_early_init() in [1/2]
  - Remove unnecessary braces and add reviewed-by in [2/2]

Green Wan (2):
  arch: riscv: cpu: Add callback to init each core
  board: sifive: unmatched: clear feature disable CSR

 arch/riscv/cpu/cpu.c         | 15 +++++++++++++++
 arch/riscv/cpu/start.S       | 14 ++++++++++++++
 board/sifive/unmatched/spl.c | 15 +++++++++++++++
 3 files changed, 44 insertions(+)

-- 
2.31.0

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-04-16 12:42 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  5:26 [RFC PATCH v4 0/2] arch: riscv: cpu: Add callback to init each core Green Wan
2021-03-30  5:26 ` [RFC PATCH v4 1/2] " Green Wan
2021-04-02 22:53   ` Sean Anderson
2021-04-06  9:15     ` Bin Meng
     [not found]       ` <752D002CFF5D0F4FA35C0100F1D73F3FE5E931A0@ATCPCS12.andestech.com>
2021-04-09  8:16         ` Rick Chen
2021-04-09 13:17           ` Sean Anderson
2021-04-09 16:05             ` Green Wan
2021-04-11 15:43               ` Sean Anderson
2021-04-12  2:33                 ` Green Wan
     [not found]                   ` <752D002CFF5D0F4FA35C0100F1D73F3FE5E95C00@ATCPCS12.andestech.com>
2021-04-13  2:39                     ` Rick Chen
2021-04-13  2:42                       ` Green Wan
2021-04-13  2:54                       ` Sean Anderson
2021-04-13  4:12                         ` Rick Chen
2021-04-13  4:17                           ` Sean Anderson
2021-04-13  8:47                             ` Green Wan
2021-04-14  1:05                             ` Rick Chen
2021-04-16 12:42                               ` Sean Anderson
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FE5E95C2F@ATCPCS12.andestech.com>
2021-04-13  3:33     ` Rick Chen
2021-04-13  8:21       ` Green Wan
2021-03-30  5:26 ` [RFC PATCH v4 2/2] board: sifive: unmatched: clear feature disable CSR Green Wan
2021-04-06  9:16   ` Bin Meng
2021-04-06 15:35     ` Green Wan

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.