-
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.
yaml --- r: 123622 b: refs/heads/master c: 6781002 h: refs/heads/master v: v3
- Loading branch information
Andrew Victor
authored and
Russell King
committed
Dec 1, 2008
1 parent
9637885
commit 30e193e
Showing
4 changed files
with
87 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 37efe6427dd50e889473fb3c7fcec02dbbd098eb | ||
refs/heads/master: 6781002bec5237ee8ac1e1daeb0ba976e780a884 |
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,47 @@ | ||
/* | ||
* linux/arch/arm/mach-at91/sam9_smc.c | ||
* | ||
* Copyright (C) 2008 Andrew Victor | ||
* | ||
* 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/module.h> | ||
#include <linux/io.h> | ||
|
||
#include <mach/at91sam9_smc.h> | ||
|
||
#include "sam9_smc.h" | ||
|
||
void __init sam9_smc_configure(int cs, struct sam9_smc_config* config) | ||
{ | ||
/* Setup register */ | ||
at91_sys_write(AT91_SMC_SETUP(cs), | ||
AT91_SMC_NWESETUP_(config->nwe_setup) | ||
| AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup) | ||
| AT91_SMC_NRDSETUP_(config->nrd_setup) | ||
| AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup) | ||
); | ||
|
||
/* Pulse register */ | ||
at91_sys_write(AT91_SMC_PULSE(cs), | ||
AT91_SMC_NWEPULSE_(config->nwe_pulse) | ||
| AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse) | ||
| AT91_SMC_NRDPULSE_(config->nrd_pulse) | ||
| AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse) | ||
); | ||
|
||
/* Cycle register */ | ||
at91_sys_write(AT91_SMC_CYCLE(cs), | ||
AT91_SMC_NWECYCLE_(config->write_cycle) | ||
| AT91_SMC_NRDCYCLE_(config->read_cycle) | ||
); | ||
|
||
/* Mode register */ | ||
at91_sys_write(AT91_SMC_MODE(cs), | ||
config->mode | ||
| AT91_SMC_TDF_(config->tdf_cycles) | ||
); | ||
} |
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,33 @@ | ||
/* | ||
* linux/arch/arm/mach-at91/sam9_smc. | ||
* | ||
* Copyright (C) 2008 Andrew Victor | ||
* | ||
* 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. | ||
*/ | ||
|
||
struct sam9_smc_config { | ||
/* Setup register */ | ||
u8 ncs_read_setup; | ||
u8 nrd_setup; | ||
u8 ncs_write_setup; | ||
u8 nwe_setup; | ||
|
||
/* Pulse register */ | ||
u8 ncs_read_pulse; | ||
u8 nrd_pulse; | ||
u8 ncs_write_pulse; | ||
u8 nwe_pulse; | ||
|
||
/* Cycle register */ | ||
u16 read_cycle; | ||
u16 write_cycle; | ||
|
||
/* Mode register */ | ||
u32 mode; | ||
u8 tdf_cycles:4; | ||
}; | ||
|
||
extern void __init sam9_smc_configure(int cs, struct sam9_smc_config* config); |