Browse Source

lib: sbi_hart: Remove HART available mask and related APIs

The HART available mask and related APIs are now totally redundant
because of more extensive HART state machine implemented by sbi_hsm.

Due to above, we remove HART available mask and related APIs.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Anup Patel 4 years ago
parent
commit
eede1aa7c7
3 changed files with 0 additions and 41 deletions
  1. 0 6
      include/sbi/sbi_hart.h
  2. 0 29
      lib/sbi/sbi_hart.c
  3. 0 6
      lib/sbi/sbi_init.c

+ 0 - 6
include/sbi/sbi_hart.h

@@ -32,12 +32,6 @@ sbi_hart_switch_mode(unsigned long arg0, unsigned long arg1,
 		     unsigned long next_addr, unsigned long next_mode,
 		     bool next_virt);
 
-void sbi_hart_mark_available(u32 hartid);
-
-ulong sbi_hart_available_mask(void);
-
-void sbi_hart_unmark_available(u32 hartid);
-
 struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,
 					   u32 hartid);
 

+ 0 - 29
lib/sbi/sbi_hart.c

@@ -11,7 +11,6 @@
 #include <sbi/riscv_barrier.h>
 #include <sbi/riscv_encoding.h>
 #include <sbi/riscv_fp.h>
-#include <sbi/riscv_locks.h>
 #include <sbi/sbi_bitops.h>
 #include <sbi/sbi_console.h>
 #include <sbi/sbi_error.h>
@@ -342,34 +341,6 @@ sbi_hart_switch_mode(unsigned long arg0, unsigned long arg1,
 	__builtin_unreachable();
 }
 
-static spinlock_t avail_hart_mask_lock        = SPIN_LOCK_INITIALIZER;
-static volatile unsigned long avail_hart_mask = 0;
-
-void sbi_hart_mark_available(u32 hartid)
-{
-	spin_lock(&avail_hart_mask_lock);
-	avail_hart_mask |= (1UL << hartid);
-	spin_unlock(&avail_hart_mask_lock);
-}
-
-void sbi_hart_unmark_available(u32 hartid)
-{
-	spin_lock(&avail_hart_mask_lock);
-	avail_hart_mask &= ~(1UL << hartid);
-	spin_unlock(&avail_hart_mask_lock);
-}
-
-ulong sbi_hart_available_mask(void)
-{
-	ulong ret;
-
-	spin_lock(&avail_hart_mask_lock);
-	ret = avail_hart_mask;
-	spin_unlock(&avail_hart_mask_lock);
-
-	return ret;
-}
-
 typedef struct sbi_scratch *(*h2s)(ulong hartid);
 
 struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,

+ 0 - 6
lib/sbi/sbi_init.c

@@ -196,8 +196,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 
 	wake_coldboot_harts(scratch, hartid);
 
-	sbi_hart_mark_available(hartid);
-
 	init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
 	(*init_count)++;
 
@@ -249,8 +247,6 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	sbi_hart_mark_available(hartid);
-
 	init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
 	(*init_count)++;
 
@@ -326,8 +322,6 @@ void __noreturn sbi_exit(struct sbi_scratch *scratch)
 	if (sbi_platform_hart_disabled(plat, hartid))
 		sbi_hart_hang();
 
-	sbi_hart_unmark_available(hartid);
-
 	sbi_platform_early_exit(plat);
 
 	sbi_timer_exit(scratch);