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
nexedi
linux
Commits
7ef56c66
Commit
7ef56c66
authored
Aug 30, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.6-rmk
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
96cf2a82
4aaed07f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
258 additions
and
3 deletions
+258
-3
arch/arm/mach-s3c2410/s3c2440-dsc.c
arch/arm/mach-s3c2410/s3c2440-dsc.c
+57
-0
arch/arm/mach-s3c2410/time.c
arch/arm/mach-s3c2410/time.c
+16
-3
include/asm-arm/arch-s3c2410/regs-dsc.h
include/asm-arm/arch-s3c2410/regs-dsc.h
+183
-0
include/asm-arm/arch-s3c2410/regs-timer.h
include/asm-arm/arch-s3c2410/regs-timer.h
+2
-0
No files found.
arch/arm/mach-s3c2410/s3c2440-dsc.c
0 → 100644
View file @
7ef56c66
/* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c
*
* Copyright (c) 2004 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* Samsung S3C2440 Drive Strength Control support
*
* 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.
*
* Modifications:
* 29-Aug-2004 BJD Start of drive-strength control
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/device.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-dsc.h>
#include "s3c2440.h"
#include "cpu.h"
int
s3c2440_set_dsc
(
unsigned
int
pin
,
unsigned
int
value
)
{
unsigned
long
base
;
unsigned
long
val
;
unsigned
long
flags
;
unsigned
long
mask
;
base
=
(
pin
&
S3C2440_SELECT_DSC1
)
?
S3C2440_DSC1
:
S3C2440_DSC0
;
mask
=
3
<<
S3C2440_DSC_GETSHIFT
(
pin
);
local_irq_save
(
flags
);
val
=
__raw_readl
(
base
);
val
&=
~
mask
;
val
|=
value
&
mask
;
__raw_writel
(
val
,
base
);
local_irq_restore
(
flags
);
return
0
;
}
arch/arm/mach-s3c2410/time.c
View file @
7ef56c66
...
@@ -31,14 +31,12 @@
...
@@ -31,14 +31,12 @@
#include <asm/irq.h>
#include <asm/irq.h>
#include <asm/arch/map.h>
#include <asm/arch/map.h>
#include <asm/arch/regs-timer.h>
#include <asm/arch/regs-timer.h>
#include <asm/arch/regs-irq.h>
#include <asm/mach/time.h>
#include <asm/mach/time.h>
static
unsigned
long
timer_startval
;
static
unsigned
long
timer_startval
;
static
unsigned
long
timer_ticks_usec
;
static
unsigned
long
timer_ticks_usec
;
#ifdef CONFIG_S3C2410_RTC
extern
void
s3c2410_rtc_check
();
#endif
/* with an 12MHz clock, we get 12 ticks per-usec
/* with an 12MHz clock, we get 12 ticks per-usec
*/
*/
...
@@ -49,15 +47,30 @@ extern void s3c2410_rtc_check();
...
@@ -49,15 +47,30 @@ extern void s3c2410_rtc_check();
* will have been disabled by do_gettimeoffset()
* will have been disabled by do_gettimeoffset()
* IRQs are disabled before entering here from do_gettimeofday()
* IRQs are disabled before entering here from do_gettimeofday()
*/
*/
#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
static
unsigned
long
s3c2410_gettimeoffset
(
void
)
static
unsigned
long
s3c2410_gettimeoffset
(
void
)
{
{
unsigned
long
tdone
;
unsigned
long
tdone
;
unsigned
long
usec
;
unsigned
long
usec
;
unsigned
long
irqpend
;
/* work out how many ticks have gone since last timer interrupt */
/* work out how many ticks have gone since last timer interrupt */
tdone
=
timer_startval
-
__raw_readl
(
S3C2410_TCNTO
(
4
));
tdone
=
timer_startval
-
__raw_readl
(
S3C2410_TCNTO
(
4
));
/* check to see if there is an interrupt pending */
irqpend
=
__raw_readl
(
S3C2410_SRCPND
);
if
(
irqpend
&
SRCPND_TIMER4
)
{
/* re-read the timer, and try and fix up for the missed
* interrupt */
tdone
=
timer_startval
-
__raw_readl
(
S3C2410_TCNTO
(
4
));
tdone
+=
1
<<
16
;
}
/* currently, tcnt is in 12MHz units, but this may change
/* currently, tcnt is in 12MHz units, but this may change
* for non-bast machines...
* for non-bast machines...
*/
*/
...
...
include/asm-arm/arch-s3c2410/regs-dsc.h
0 → 100644
View file @
7ef56c66
/* linux/include/asm/hardware/s3c2410/regs-dsc.h
*
* Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
* http://www.simtec.co.uk/products/SWLINUX/
*
* 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.
*
* S3C2440 Signal Drive Strength Control
*
* Changelog:
* 11-Aug-2004 BJD Created file
* 25-Aug-2004 BJD Added the _SELECT_* defs for using with functions
*/
#ifndef __ASM_ARCH_REGS_DSC_H
#define __ASM_ARCH_REGS_DSC_H "2440-dsc"
#ifdef CONFIG_CPU_S3C2440
#define S3C2440_DSC0 S3C2410_GPIOREG(0xc0)
#define S3C2440_DSC1 S3C2410_GPIOREG(0xc4)
#define S3C2440_SELECT_DSC0 (0)
#define S3C2440_SELECT_DSC1 (1<<31)
#define S3C2440_DSC_GETSHIFT(x) ((x) & 31)
#define S3C2440_DSC0_ENABLE (1<<31)
#define S3C2440_DSC0_ADDR (S3C2440_SELECT_DSC0 | 8)
#define S3C2440_DSC0_ADDR_12mA (0<<8)
#define S3C2440_DSC0_ADDR_10mA (1<<8)
#define S3C2440_DSC0_ADDR_8mA (2<<8)
#define S3C2440_DSC0_ADDR_6mA (3<<8)
#define S3C2440_DSC0_ADDR_MASK (3<<8)
/* D24..D31 */
#define S3C2440_DSC0_DATA3 (S3C2440_SELECT_DSC0 | 6)
#define S3C2440_DSC0_DATA3_12mA (0<<6)
#define S3C2440_DSC0_DATA3_10mA (1<<6)
#define S3C2440_DSC0_DATA3_8mA (2<<6)
#define S3C2440_DSC0_DATA3_6mA (3<<6)
#define S3C2440_DSC0_DATA3_MASK (3<<6)
/* D16..D23 */
#define S3C2440_DSC0_DATA2 (S3C2440_SELECT_DSC0 | 4)
#define S3C2440_DSC0_DATA2_12mA (0<<4)
#define S3C2440_DSC0_DATA2_10mA (1<<4)
#define S3C2440_DSC0_DATA2_8mA (2<<4)
#define S3C2440_DSC0_DATA2_6mA (3<<4)
#define S3C2440_DSC0_DATA2_MASK (3<<4)
/* D8..D15 */
#define S3C2440_DSC0_DATA1 (S3C2440_SELECT_DSC0 | 2)
#define S3C2440_DSC0_DATA1_12mA (0<<2)
#define S3C2440_DSC0_DATA1_10mA (1<<2)
#define S3C2440_DSC0_DATA1_8mA (2<<2)
#define S3C2440_DSC0_DATA1_6mA (3<<2)
#define S3C2440_DSC0_DATA1_MASK (3<<2)
/* D0..D7 */
#define S3C2440_DSC0_DATA0 (S3C2440_SELECT_DSC0 | 0)
#define S3C2440_DSC0_DATA0_12mA (0<<0)
#define S3C2440_DSC0_DATA0_10mA (1<<0)
#define S3C2440_DSC0_DATA0_8mA (2<<0)
#define S3C2440_DSC0_DATA0_6mA (3<<0)
#define S3C2440_DSC0_DATA0_MASK (3<<0)
#define S3C2440_DSC1_SCK0 (S3C2440_SELECT_DSC1 | 28)
#define S3C2440_DSC1_SCK0_12mA (0<<28)
#define S3C2440_DSC1_SCK0_10mA (1<<28)
#define S3C2440_DSC1_SCK0_8mA (2<<28)
#define S3C2440_DSC1_SCK0_6mA (3<<28)
#define S3C2440_DSC1_SCK0_MASK (3<<28)
#define S3C2440_DSC1_SCK1 (S3C2440_SELECT_DSC1 | 26)
#define S3C2440_DSC1_SCK1_12mA (0<<26)
#define S3C2440_DSC1_SCK1_10mA (1<<26)
#define S3C2440_DSC1_SCK1_8mA (2<<26)
#define S3C2440_DSC1_SCK1_6mA (3<<26)
#define S3C2440_DSC1_SCK1_MASK (3<<26)
#define S3C2440_DSC1_SCKE (S3C2440_SELECT_DSC1 | 24)
#define S3C2440_DSC1_SCKE_10mA (0<<24)
#define S3C2440_DSC1_SCKE_8mA (1<<24)
#define S3C2440_DSC1_SCKE_6mA (2<<24)
#define S3C2440_DSC1_SCKE_4mA (3<<24)
#define S3C2440_DSC1_SCKE_MASK (3<<24)
/* SDRAM nRAS/nCAS */
#define S3C2440_DSC1_SDR (S3C2440_SELECT_DSC1 | 22)
#define S3C2440_DSC1_SDR_10mA (0<<22)
#define S3C2440_DSC1_SDR_8mA (1<<22)
#define S3C2440_DSC1_SDR_6mA (2<<22)
#define S3C2440_DSC1_SDR_4mA (3<<22)
#define S3C2440_DSC1_SDR_MASK (3<<22)
/* NAND Flash Controller */
#define S3C2440_DSC1_NFC (S3C2440_SELECT_DSC1 | 20)
#define S3C2440_DSC1_NFC_10mA (0<<20)
#define S3C2440_DSC1_NFC_8mA (1<<20)
#define S3C2440_DSC1_NFC_6mA (2<<20)
#define S3C2440_DSC1_NFC_4mA (3<<20)
#define S3C2440_DSC1_NFC_MASK (3<<20)
/* nBE[0..3] */
#define S3C2440_DSC1_nBE (S3C2440_SELECT_DSC1 | 18)
#define S3C2440_DSC1_nBE_10mA (0<<18)
#define S3C2440_DSC1_nBE_8mA (1<<18)
#define S3C2440_DSC1_nBE_6mA (2<<18)
#define S3C2440_DSC1_nBE_4mA (3<<18)
#define S3C2440_DSC1_nBE_MASK (3<<18)
#define S3C2440_DSC1_WOE (S3C2440_SELECT_DSC1 | 16)
#define S3C2440_DSC1_WOE_10mA (0<<16)
#define S3C2440_DSC1_WOE_8mA (1<<16)
#define S3C2440_DSC1_WOE_6mA (2<<16)
#define S3C2440_DSC1_WOE_4mA (3<<16)
#define S3C2440_DSC1_WOE_MASK (3<<16)
#define S3C2440_DSC1_CS7 (S3C2440_SELECT_DSC1 | 14)
#define S3C2440_DSC1_CS7_10mA (0<<14)
#define S3C2440_DSC1_CS7_8mA (1<<14)
#define S3C2440_DSC1_CS7_6mA (2<<14)
#define S3C2440_DSC1_CS7_4mA (3<<14)
#define S3C2440_DSC1_CS7_MASK (3<<14)
#define S3C2440_DSC1_CS6 (S3C2440_SELECT_DSC1 | 12)
#define S3C2440_DSC1_CS6_10mA (0<<12)
#define S3C2440_DSC1_CS6_8mA (1<<12)
#define S3C2440_DSC1_CS6_6mA (2<<12)
#define S3C2440_DSC1_CS6_4mA (3<<12)
#define S3C2440_DSC1_CS6_MASK (3<<12)
#define S3C2440_DSC1_CS5 (S3C2440_SELECT_DSC1 | 10)
#define S3C2440_DSC1_CS5_10mA (0<<10)
#define S3C2440_DSC1_CS5_8mA (1<<10)
#define S3C2440_DSC1_CS5_6mA (2<<10)
#define S3C2440_DSC1_CS5_4mA (3<<10)
#define S3C2440_DSC1_CS5_MASK (3<<10)
#define S3C2440_DSC1_CS4 (S3C2440_SELECT_DSC1 | 8)
#define S3C2440_DSC1_CS4_10mA (0<<8)
#define S3C2440_DSC1_CS4_8mA (1<<8)
#define S3C2440_DSC1_CS4_6mA (2<<8)
#define S3C2440_DSC1_CS4_4mA (3<<8)
#define S3C2440_DSC1_CS4_MASK (3<<8)
#define S3C2440_DSC1_CS3 (S3C2440_SELECT_DSC1 | 6)
#define S3C2440_DSC1_CS3_10mA (0<<6)
#define S3C2440_DSC1_CS3_8mA (1<<6)
#define S3C2440_DSC1_CS3_6mA (2<<6)
#define S3C2440_DSC1_CS3_4mA (3<<6)
#define S3C2440_DSC1_CS3_MASK (3<<6)
#define S3C2440_DSC1_CS2 (S3C2440_SELECT_DSC1 | 4)
#define S3C2440_DSC1_CS2_10mA (0<<4)
#define S3C2440_DSC1_CS2_8mA (1<<4)
#define S3C2440_DSC1_CS2_6mA (2<<4)
#define S3C2440_DSC1_CS2_4mA (3<<4)
#define S3C2440_DSC1_CS2_MASK (3<<4)
#define S3C2440_DSC1_CS1 (S3C2440_SELECT_DSC1 | 2)
#define S3C2440_DSC1_CS1_10mA (0<<2)
#define S3C2440_DSC1_CS1_8mA (1<<2)
#define S3C2440_DSC1_CS1_6mA (2<<2)
#define S3C2440_DSC1_CS1_4mA (3<<2)
#define S3C2440_DSC1_CS1_MASK (3<<2)
#define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0
#define S3C2440_DSC1_CS0_10mA (0<<0)
#define S3C2440_DSC1_CS0_8mA (1<<0)
#define S3C2440_DSC1_CS0_6mA (2<<0)
#define S3C2440_DSC1_CS0_4mA (3<<0)
#define S3C2440_DSC1_CS0_MASK (3<<0)
#endif
/* CONFIG_CPU_S3C2440 */
#endif
/* __ASM_ARCH_REGS_DSC_H */
include/asm-arm/arch-s3c2410/regs-timer.h
View file @
7ef56c66
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
#define S3C2410_TCFG_DEADZONE_MASK (255<<16)
#define S3C2410_TCFG_DEADZONE_SHIFT (16)
#define S3C2410_TCFG1_MUX4_DIV2 (0<<16)
#define S3C2410_TCFG1_MUX4_DIV2 (0<<16)
#define S3C2410_TCFG1_MUX4_DIV4 (1<<16)
#define S3C2410_TCFG1_MUX4_DIV4 (1<<16)
...
...
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