-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] smp: separate SCU support code from realview
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
- Loading branch information
Russell King
authored and
Russell King
committed
May 17, 2009
1 parent
49613d4
commit a8cbcd9
Showing
5 changed files
with
56 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
#ifndef __ASMARM_ARCH_SCU_H | ||
#define __ASMARM_ARCH_SCU_H | ||
|
||
/* | ||
* SCU registers | ||
*/ | ||
#define SCU_CTRL 0x00 | ||
#define SCU_CONFIG 0x04 | ||
#define SCU_CPU_STATUS 0x08 | ||
#define SCU_INVALIDATE 0x0c | ||
#define SCU_FPGA_REVISION 0x10 | ||
unsigned int scu_get_core_count(void __iomem *); | ||
void scu_enable(void __iomem *); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* linux/arch/arm/kernel/smp_scu.c | ||
* | ||
* Copyright (C) 2002 ARM Ltd. | ||
* All Rights Reserved | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/init.h> | ||
#include <linux/io.h> | ||
|
||
#include <asm/smp_scu.h> | ||
|
||
#define SCU_CTRL 0x00 | ||
#define SCU_CONFIG 0x04 | ||
#define SCU_CPU_STATUS 0x08 | ||
#define SCU_INVALIDATE 0x0c | ||
#define SCU_FPGA_REVISION 0x10 | ||
|
||
/* | ||
* Get the number of CPU cores from the SCU configuration | ||
*/ | ||
unsigned int __init scu_get_core_count(void __iomem *scu_base) | ||
{ | ||
unsigned int ncores = __raw_readl(scu_base + SCU_CONFIG); | ||
return (ncores & 0x03) + 1; | ||
} | ||
|
||
/* | ||
* Enable the SCU | ||
*/ | ||
void __init scu_enable(void __iomem *scu_base) | ||
{ | ||
u32 scu_ctrl; | ||
|
||
scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | ||
scu_ctrl |= 1; | ||
__raw_writel(scu_ctrl, scu_base + SCU_CTRL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters