Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
be12ab23
Commit
be12ab23
authored
Feb 06, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Add cm_control() for Integrator AP and PP2 platforms.
parent
f99d18fe
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
16 deletions
+66
-16
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/core.c
+25
-0
arch/arm/mach-integrator/leds.c
arch/arm/mach-integrator/leds.c
+3
-9
include/asm-arm/arch-integrator/cm.h
include/asm-arm/arch-integrator/cm.h
+36
-0
include/asm-arm/arch-integrator/system.h
include/asm-arm/arch-integrator/system.h
+2
-7
No files found.
arch/arm/mach-integrator/core.c
View file @
be12ab23
...
@@ -11,10 +11,13 @@
...
@@ -11,10 +11,13 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/device.h>
#include <linux/spinlock.h>
#include <asm/hardware.h>
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/hardware/amba.h>
#include <asm/hardware/amba.h>
#include <asm/arch/cm.h>
static
struct
amba_device
rtc_device
=
{
static
struct
amba_device
rtc_device
=
{
.
dev
=
{
.
dev
=
{
...
@@ -102,3 +105,25 @@ static int __init integrator_init(void)
...
@@ -102,3 +105,25 @@ static int __init integrator_init(void)
}
}
arch_initcall
(
integrator_init
);
arch_initcall
(
integrator_init
);
#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
static
spinlock_t
cm_lock
;
/**
* cm_control - update the CM_CTRL register.
* @mask: bits to change
* @set: bits to set
*/
void
cm_control
(
u32
mask
,
u32
set
)
{
unsigned
long
flags
;
u32
val
;
spin_lock_irqsave
(
&
cm_lock
,
flags
);
val
=
readl
(
CM_CTRL
)
&
~
mask
;
writel
(
val
|
set
,
CM_CTRL
);
spin_unlock_irqrestore
(
&
cm_lock
,
flags
);
}
EXPORT_SYMBOL
(
cm_control
);
arch/arm/mach-integrator/leds.c
View file @
be12ab23
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <asm/leds.h>
#include <asm/leds.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
#include <asm/arch/cm.h>
static
int
saved_leds
;
static
int
saved_leds
;
...
@@ -35,9 +36,6 @@ static void integrator_leds_event(led_event_t ledevt)
...
@@ -35,9 +36,6 @@ static void integrator_leds_event(led_event_t ledevt)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
const
unsigned
int
dbg_base
=
IO_ADDRESS
(
INTEGRATOR_DBG_BASE
);
const
unsigned
int
dbg_base
=
IO_ADDRESS
(
INTEGRATOR_DBG_BASE
);
const
unsigned
int
hdr_ctrl
=
IO_ADDRESS
(
INTEGRATOR_HDR_BASE
)
+
INTEGRATOR_HDR_CTRL_OFFSET
;
unsigned
int
ctrl
;
unsigned
int
update_alpha_leds
;
unsigned
int
update_alpha_leds
;
// yup, change the LEDs
// yup, change the LEDs
...
@@ -46,15 +44,11 @@ static void integrator_leds_event(led_event_t ledevt)
...
@@ -46,15 +44,11 @@ static void integrator_leds_event(led_event_t ledevt)
switch
(
ledevt
)
{
switch
(
ledevt
)
{
case
led_idle_start
:
case
led_idle_start
:
ctrl
=
__raw_readl
(
hdr_ctrl
);
cm_control
(
CM_CTRL_LED
,
0
);
ctrl
&=
~
INTEGRATOR_HDR_CTRL_LED
;
__raw_writel
(
ctrl
,
hdr_ctrl
);
break
;
break
;
case
led_idle_end
:
case
led_idle_end
:
ctrl
=
__raw_readl
(
hdr_ctrl
);
cm_control
(
CM_CTRL_LED
,
CM_CTRL_LED
);
ctrl
|=
INTEGRATOR_HDR_CTRL_LED
;
__raw_writel
(
ctrl
,
hdr_ctrl
);
break
;
break
;
case
led_timer
:
case
led_timer
:
...
...
include/asm-arm/arch-integrator/cm.h
0 → 100644
View file @
be12ab23
/*
* update the core module control register.
*/
void
cm_control
(
u32
,
u32
);
#define CM_CTRL_LED (1 << 0)
#define CM_CTRL_nMBDET (1 << 1)
#define CM_CTRL_REMAP (1 << 2)
#define CM_CTRL_RESET (1 << 3)
/*
* Integrator/AP,PP2 specific
*/
#define CM_CTRL_HIGHVECTORS (1 << 4)
#define CM_CTRL_BIGENDIAN (1 << 5)
#define CM_CTRL_FASTBUS (1 << 6)
#define CM_CTRL_SYNC (1 << 7)
/*
* ARM926/946/966 Integrator/CP specific
*/
#define CM_CTRL_LCDBIASEN (1 << 8)
#define CM_CTRL_LCDBIASUP (1 << 9)
#define CM_CTRL_LCDBIASDN (1 << 10)
#define CM_CTRL_LCDMUXSEL_MASK (7 << 11)
#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11)
#define CM_CTRL_LCDMUXSEL_SHARPLCD1 (3 << 11)
#define CM_CTRL_LCDMUXSEL_SHARPLCD2 (4 << 11)
#define CM_CTRL_LCDMUXSEL_VGA (7 << 11)
#define CM_CTRL_LCDEN0 (1 << 14)
#define CM_CTRL_LCDEN1 (1 << 15)
#define CM_CTRL_STATIC1 (1 << 16)
#define CM_CTRL_STATIC2 (1 << 17)
#define CM_CTRL_STATIC (1 << 18)
#define CM_CTRL_n24BITEN (1 << 19)
#define CM_CTRL_EBIWP (1 << 20)
include/asm-arm/arch-integrator/system.h
View file @
be12ab23
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#ifndef __ASM_ARCH_SYSTEM_H
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <asm/arch/
platfor
m.h>
#include <asm/arch/
c
m.h>
static
inline
void
arch_idle
(
void
)
static
inline
void
arch_idle
(
void
)
{
{
...
@@ -34,16 +34,11 @@ static inline void arch_idle(void)
...
@@ -34,16 +34,11 @@ static inline void arch_idle(void)
static
inline
void
arch_reset
(
char
mode
)
static
inline
void
arch_reset
(
char
mode
)
{
{
unsigned
int
hdr_ctrl
=
(
IO_ADDRESS
(
INTEGRATOR_HDR_BASE
)
+
INTEGRATOR_HDR_CTRL_OFFSET
);
unsigned
int
val
;
/*
/*
* To reset, we hit the on-board reset register
* To reset, we hit the on-board reset register
* in the system FPGA
* in the system FPGA
*/
*/
val
=
__raw_readl
(
hdr_ctrl
);
cm_control
(
CM_CTRL_RESET
,
CM_CTRL_RESET
);
val
|=
INTEGRATOR_HDR_CTRL_RESET
;
__raw_writel
(
val
,
hdr_ctrl
);
}
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment