add new CONFIG_AT91_LEGACY
PATCH v3 1/9 add new CONFIG_AT91_LEGACY
* add's the new temporary CONFIG_AT91_LEGACY to all board configs
* This will need for backward compatiblity, while change the SoC access to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated SoC is used.
* please see README.at91-soc for details
--- doc/README.at91-soc | 42 ++++++++++++++++++++++++++++++++++++ include/configs/afeb9260.h | 2 + include/configs/at91cap9adk.h | 2 + include/configs/at91rm9200dk.h | 2 + include/configs/at91rm9200ek.h | 2 + include/configs/at91sam9260ek.h | 2 + include/configs/at91sam9261ek.h | 2 + include/configs/at91sam9263ek.h | 2 + include/configs/at91sam9m10g45ek.h | 2 + include/configs/at91sam9rlek.h | 2 + include/configs/cmc_pu2.h | 2 + include/configs/cpu9260.h | 2 + include/configs/cpuat91.h | 2 + include/configs/csb637.h | 2 + include/configs/kb9202.h | 2 + include/configs/m501sk.h | 2 + include/configs/meesc.h | 2 + include/configs/mp2usb.h | 2 + include/configs/pm9261.h | 2 + include/configs/pm9263.h | 2 + include/configs/sbc35_a9g20.h | 2 + include/configs/tny_a9260.h | 2 + 22 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 doc/README.at91-soc
doc/README.at91-soc new file +42 -0
@@ -0,0 +1,42 @@ + New C structure AT91 SoC access +================================= + +The gool +-------- + +Currently the at91 arch uses hundreds of address defines and special +at91_xxxx_write/read functions to access the SOC. +The u-boot project prefer the better to readable access via c stuctures, +which describe the SoC peripherie. + +e.g. old + + *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + + at91_sys_write(AT91_RSTC_CR, + AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); + +e.g new + pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + writel(pin, &pio->pioa.idr); + writel(pin, &pio->pioa.pudr); + writel(pin, &pio->pioa.per); + writel(pin, &pio->pioa.oer); + writel(pin, &pio->pioa.sodr); + + writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST | + AT91_RSTC_CR_PERRST, &rstc->cr); + +The Way +------- + +1. add's the new temporary CONFIG_AT91_LEGACY to all board configs + that not converted to new SoC access +2. add new structures for SoC access +3. Convert arch, driver and boards file zu new SoC +4. remove legacy code, if all boards and drives are ready +
include/configs/afeb9260.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18429952/* from 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91cap9adk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91rm9200dk.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK 59904000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/at91rm9200ek.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* * from 18.432 MHz crystal
include/configs/at91sam9260ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9261ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9263ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 16367660/* 16.367 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9m10g45ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* from 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9rlek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/cmc_pu2.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/cpu9260.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#define CONFIG_DISPLAY_CPUINFO 1#define AT91_MAIN_CLOCK 18432000
include/configs/cpuat91.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#ifdef CONFIG_CPUAT91_RAM #define CONFIG_SKIP_LOWLEVEL_INIT 1#define CONFIG_SKIP_RELOCATE_UBOOT 1
include/configs/csb637.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 184320000/* from 3.6864 MHz crystal (3686400 * 50) */ #define AT91C_MASTER_CLOCK 46080000/* (AT91C_MAIN_CLOCK/4) peripheral clock */
include/configs/kb9202.h +2 -0
@@ -29,6 +29,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 180000000/* from 10 MHz crystal */ #define AT91C_MASTER_CLOCK 60000000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/m501sk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MAIN_CLOCK 179712000
include/configs/meesc.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* Common stuff */ #define CONFIG_SYS_HZ 1000/* decrementer freq */ #define CONFIG_MEESC 1/* Board is esd MEESC */
include/configs/mp2usb.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 45) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/pm9261.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_CPU_NAME "AT91SAM9261"
include/configs/pm9263.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
include/configs/sbc35_a9g20.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_SBC35_A9G20_NANDFLASH ) || defined(CONFIG_SBC35_A9G20_EEPROM )#define CONFIG_SBC35_A9G20 #endif
include/configs/tny_a9260.h +2 -0
@@ -30,6 +30,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_TNY_A9260_NANDFLASH ) || defined(CONFIG_TNY_A9260_EEPROM )#define CONFIG_TNY_A9260 #elif defined(CONFIG_TNY_A9G20_NANDFLASH ) || defined(CONFIG_TNY_A9G20_EEPROM )
PATCH v3 1/9 add new CONFIG_AT91_LEGACY
Quoted 39 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs
* This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.
* please see README.at91-soc for detailsSigned-off-by Jens Scharsig <[email protected]>--- doc/README.at91-soc | 42 ++++++++++++++++++++++++++++++++++++ include/configs/afeb9260.h | 2 + include/configs/at91cap9adk.h | 2 + include/configs/at91rm9200dk.h | 2 + include/configs/at91rm9200ek.h | 2 + include/configs/at91sam9260ek.h | 2 + include/configs/at91sam9261ek.h | 2 + include/configs/at91sam9263ek.h | 2 + include/configs/at91sam9m10g45ek.h | 2 + include/configs/at91sam9rlek.h | 2 + include/configs/cmc_pu2.h | 2 + include/configs/cpu9260.h | 2 + include/configs/cpuat91.h | 2 + include/configs/csb637.h | 2 + include/configs/kb9202.h | 2 + include/configs/m501sk.h | 2 + include/configs/meesc.h | 2 + include/configs/mp2usb.h | 2 + include/configs/pm9261.h | 2 + include/configs/pm9263.h | 2 + include/configs/sbc35_a9g20.h | 2 + include/configs/tny_a9260.h | 2 + 22 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 doc/README.at91-socdoc/README.at91-soc new file +0
-0
doc/README.at91-soc line 5
Quoted 5 lines
doc/README.at91-soc new file +5
-0@@ -0,0 +1,42 @@ + New C structure AT91 SoC access +================================= + +The gool +--------
change to 'goal'
doc/README.at91-soc line 11
Quoted 6 lines
doc/README.at91-soc new file +6
-0+ +Currently the at91 arch uses hundreds of address defines and special +at91_xxxx_write/read functions to access the SOC. +The u-boot project prefer the better to readable access via c stuctures, +which describe the SoC peripherie. +
change to
'The u-boot project perferred method is to access memory mapped hw regisister via a c structure'
Quoted 13 lines
doc/README.at91-soc new file +13
-0+e.g. old + + *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + + at91_sys_write(AT91_RSTC_CR, + AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); + +e.g new + pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
doc/README.at91-soc line 34
Quoted 10 lines
doc/README.at91-soc new file +10
-0+ writel(pin, &pio->pioa.idr); + writel(pin, &pio->pioa.pudr); + writel(pin, &pio->pioa.per); + writel(pin, &pio->pioa.oer); + writel(pin, &pio->pioa.sodr); + + writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST | + AT91_RSTC_CR_PERRST, &rstc->cr); + +The Way
Change to
'The method for updating'
doc/README.at91-soc line 38
Quoted 4 lines
doc/README.at91-soc new file +4
-0+------- + +1. add's the new temporary CONFIG_AT91_LEGACY to all board configs + that not converted to new SoC access
Change to something like
'Display a compile time warning if the board has not been converted'
doc/README.at91-soc line 40
Quoted 2 lines
doc/README.at91-soc new file +2
-0+2. add new structures for SoC access +3. Convert arch, driver and boards file zu new SoC
Change from 'zu new SoC' to 'to the new c stucture based SoC acesss'
This readme is a big help
Thanks
Tom
PATCH 1/9 add new CONFIG_AT91_LEGACY
In reply to Jens Scharsig* add's the new temporary CONFIG_AT91_LEGACY to all board configs This will need for backward compatiblity, while change the SoC access to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated SoC is used.
--- doc/README.at91-soc | 41 ++++++++++++++++++++++++++++++++++++ include/configs/afeb9260.h | 2 + include/configs/at91cap9adk.h | 2 + include/configs/at91rm9200dk.h | 2 + include/configs/at91rm9200ek.h | 2 + include/configs/at91sam9260ek.h | 2 + include/configs/at91sam9261ek.h | 2 + include/configs/at91sam9263ek.h | 2 + include/configs/at91sam9m10g45ek.h | 2 + include/configs/at91sam9rlek.h | 2 + include/configs/cmc_pu2.h | 2 + include/configs/cpu9260.h | 2 + include/configs/cpuat91.h | 2 + include/configs/csb637.h | 2 + include/configs/kb9202.h | 2 + include/configs/m501sk.h | 2 + include/configs/meesc.h | 2 + include/configs/mp2usb.h | 2 + include/configs/pm9261.h | 2 + include/configs/pm9263.h | 2 + include/configs/sbc35_a9g20.h | 2 + include/configs/tny_a9260.h | 2 + 22 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 doc/README.at91-soc
doc/README.at91-soc new file +41 -0
@@ -0,0 +1,41 @@ + New C structure AT91 SoC access +================================= + +The goal +-------- + +Currently the at91 arch uses hundreds of address defines and special +at91_xxxx_write/read functions to access the SOC. +The u-boot project perferred method is to access memory mapped hw +regisister via a c structure. + +e.g. old + + *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + + at91_sys_write(AT91_RSTC_CR, + AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); + +e.g new + pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + writel(pin, &pio->pioa.idr); + writel(pin, &pio->pioa.pudr); + writel(pin, &pio->pioa.per); + writel(pin, &pio->pioa.oer); + writel(pin, &pio->pioa.sodr); + + writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST | + AT91_RSTC_CR_PERRST, &rstc->cr); + +The method for updating +------------------------ + +1. add's the temporary CONFIG_AT91_LEGACY to all at91 board configs +2. Display a compile time warning, if the board has not been converted +3. add new structures for SoC access +4. Convert arch, driver and boards file to new SoC +5. remove legacy code, if all boards and drives are ready
include/configs/afeb9260.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18429952/* from 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91cap9adk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91rm9200dk.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK 59904000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/at91rm9200ek.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* * from 18.432 MHz crystal
include/configs/at91sam9260ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9261ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9263ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 16367660/* 16.367 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9m10g45ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* from 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9rlek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/cmc_pu2.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/cpu9260.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#define CONFIG_DISPLAY_CPUINFO 1#define AT91_MAIN_CLOCK 18432000
include/configs/cpuat91.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#ifdef CONFIG_CPUAT91_RAM #define CONFIG_SKIP_LOWLEVEL_INIT 1#define CONFIG_SKIP_RELOCATE_UBOOT 1
include/configs/csb637.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 184320000/* from 3.6864 MHz crystal (3686400 * 50) */ #define AT91C_MASTER_CLOCK 46080000/* (AT91C_MAIN_CLOCK/4) peripheral clock */
include/configs/kb9202.h +2 -0
@@ -29,6 +29,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 180000000/* from 10 MHz crystal */ #define AT91C_MASTER_CLOCK 60000000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/m501sk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MAIN_CLOCK 179712000
include/configs/meesc.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* Common stuff */ #define CONFIG_SYS_HZ 1000/* decrementer freq */ #define CONFIG_MEESC 1/* Board is esd MEESC */
include/configs/mp2usb.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 45) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/pm9261.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_CPU_NAME "AT91SAM9261"
include/configs/pm9263.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
include/configs/sbc35_a9g20.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_SBC35_A9G20_NANDFLASH ) || defined(CONFIG_SBC35_A9G20_EEPROM )#define CONFIG_SBC35_A9G20 #endif
include/configs/tny_a9260.h +2 -0
@@ -30,6 +30,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_TNY_A9260_NANDFLASH ) || defined(CONFIG_TNY_A9260_EEPROM )#define CONFIG_TNY_A9260 #elif defined(CONFIG_TNY_A9G20_NANDFLASH ) || defined(CONFIG_TNY_A9G20_EEPROM )
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
In reply to Jens Scharsig* add's the new temporary CONFIG_AT91_LEGACY to all board configs This will need for backward compatiblity, while change the SoC access to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated SoC is used.
--- doc/README.at91-soc | 41 ++++++++++++++++++++++++++++++++++++ include/configs/afeb9260.h | 2 + include/configs/at91cap9adk.h | 2 + include/configs/at91rm9200dk.h | 2 + include/configs/at91rm9200ek.h | 2 + include/configs/at91sam9260ek.h | 2 + include/configs/at91sam9261ek.h | 2 + include/configs/at91sam9263ek.h | 2 + include/configs/at91sam9m10g45ek.h | 2 + include/configs/at91sam9rlek.h | 2 + include/configs/cmc_pu2.h | 2 + include/configs/cpu9260.h | 2 + include/configs/cpuat91.h | 2 + include/configs/csb637.h | 2 + include/configs/kb9202.h | 2 + include/configs/m501sk.h | 2 + include/configs/meesc.h | 2 + include/configs/mp2usb.h | 2 + include/configs/pm9261.h | 2 + include/configs/pm9263.h | 2 + include/configs/sbc35_a9g20.h | 2 + include/configs/tny_a9260.h | 2 + 22 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 doc/README.at91-soc
doc/README.at91-soc new file +41 -0
@@ -0,0 +1,41 @@ + New C structure AT91 SoC access +================================= + +The goal +-------- + +Currently the at91 arch uses hundreds of address defines and special +at91_xxxx_write/read functions to access the SOC. +The u-boot project perferred method is to access memory mapped hw +regisister via a c structure. + +e.g. old + + *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + + at91_sys_write(AT91_RSTC_CR, + AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); + +e.g new + pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; + writel(pin, &pio->pioa.idr); + writel(pin, &pio->pioa.pudr); + writel(pin, &pio->pioa.per); + writel(pin, &pio->pioa.oer); + writel(pin, &pio->pioa.sodr); + + writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST | + AT91_RSTC_CR_PERRST, &rstc->cr); + +The method for updating +------------------------ + +1. add's the temporary CONFIG_AT91_LEGACY to all at91 board configs +2. Display a compile time warning, if the board has not been converted +3. add new structures for SoC access +4. Convert arch, driver and boards file to new SoC +5. remove legacy code, if all boards and drives are ready
include/configs/afeb9260.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18429952/* from 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91cap9adk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91rm9200dk.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK 59904000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/at91rm9200ek.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* * from 18.432 MHz crystal
include/configs/at91sam9260ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9261ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 18432000/* 18.432 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9263ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 16367660/* 16.367 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9m10g45ek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* from 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/at91sam9rlek.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_MAIN_CLOCK 12000000/* 12 MHz crystal */ #define CONFIG_SYS_HZ 1000
include/configs/cmc_pu2.h +2 -0
@@ -25,6 +25,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/cpu9260.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#define CONFIG_DISPLAY_CPUINFO 1#define AT91_MAIN_CLOCK 18432000
include/configs/cpuat91.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#ifdef CONFIG_CPUAT91_RAM #define CONFIG_SKIP_LOWLEVEL_INIT 1#define CONFIG_SKIP_RELOCATE_UBOOT 1
include/configs/csb637.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 184320000/* from 3.6864 MHz crystal (3686400 * 50) */ #define AT91C_MASTER_CLOCK 46080000/* (AT91C_MAIN_CLOCK/4) peripheral clock */
include/configs/kb9202.h +2 -0
@@ -29,6 +29,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 180000000/* from 10 MHz crystal */ #define AT91C_MASTER_CLOCK 60000000/* peripheral clock (AT91C_MASTER_CLOCK / 3) */
include/configs/m501sk.h +2 -0
@@ -27,6 +27,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ /* from 18.432 MHz crystal (18432000 / 4 * 39) */ #define AT91C_MAIN_CLOCK 179712000
include/configs/meesc.h +2 -0
@@ -31,6 +31,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* Common stuff */ #define CONFIG_SYS_HZ 1000/* decrementer freq */ #define CONFIG_MEESC 1/* Board is esd MEESC */
include/configs/mp2usb.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91C_MAIN_CLOCK 179712000/* from 18.432 MHz crystal (18432000 / 4 * 45) */ #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3)/* peripheral clock */
include/configs/pm9261.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define AT91_CPU_NAME "AT91SAM9261"
include/configs/pm9263.h +2 -0
@@ -28,6 +28,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +/* ARM asynchronous clock */ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO
include/configs/sbc35_a9g20.h +2 -0
@@ -26,6 +26,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_SBC35_A9G20_NANDFLASH ) || defined(CONFIG_SBC35_A9G20_EEPROM )#define CONFIG_SBC35_A9G20 #endif
include/configs/tny_a9260.h +2 -0
@@ -30,6 +30,8 @@#ifndef __CONFIG_H#define __CONFIG_H +#define CONFIG_AT91_LEGACY +#if defined(CONFIG_TNY_A9260_NANDFLASH ) || defined(CONFIG_TNY_A9260_EEPROM )#define CONFIG_TNY_A9260 #elif defined(CONFIG_TNY_A9G20_NANDFLASH ) || defined(CONFIG_TNY_A9G20_EEPROM )
Signature · 1 line
1.6.0.2
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>
This looks good.
The only problem is the new at91 target otc570 is breaking.
Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)
Tom
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Hello Tom,
Quoted 30 lines · Tom
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>This looks good.
The only problem is the new at91 target otc570 is breaking.Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)
Quoted 1 line
Tom
This is caused by missing defines in include\configs\otc570.h:
#define CONFIG_AT91_LEGACY
and
#define CONFIG_AT91_GPIO 1
Should I send a patch to fix this, or should I wait for Jens patches coming mainline?
Best regards,
Daniel Gorsulowski
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Quoted 34 lines · Daniel Gorsulowski
Hello Tom,
Quoted 29 lines · Tom
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>This looks good.
The only problem is the new at91 target otc570 is breaking.Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)Quoted 1 line
Tom
Quoted 8 lines
This is caused by missing defines in include\configs\otc570.h:
#defineCONFIG_AT91_LEGACY
and
#defineCONFIG_AT91_GPIO1Should I send a patch to fix this, or should I wait for Jens patches coming mainline?
Please send a patch.
It should be a 2-3 liner.
I will combine it with Jens' patchset and push them together. Tom
Quoted 2 lines
Best regards,
Daniel Gorsulowski
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Quoted 40 lines · Tom
Quoted 39 lines · Daniel Gorsulowski
Hello Tom,
Quoted 29 lines · Tom
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>This looks good.
The only problem is the new at91 target otc570 is breaking.Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)Quoted 1 line
Tom
This is caused by missing defines in include\configs\otc570.h:
#defineCONFIG_AT91_LEGACY
and
#defineCONFIG_AT91_GPIO1
Quoted 9 lines
Quoted 3 lines
Should I send a patch to fix this, or should I wait for Jens patches coming mainline?
Please send a patch.
It should be a 2-3 liner.
I will combine it with Jens' patchset and push them together. Tom
You probably recognized that I did not sent a patch with CONFIG_AT91_LEGACY support but I updated the otc570 board to new SoC access.
http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
I guess, this is the best solution.
Best regards,
Daniel Gorsulowski
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Quoted 48 lines · Daniel Gorsulowski
Quoted 39 lines · Tom
Quoted 38 lines · Daniel Gorsulowski
Hello Tom,
Quoted 29 lines · Tom
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>This looks good.
The only problem is the new at91 target otc570 is breaking.Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)Quoted 1 line
Tom
This is caused by missing defines in include\configs\otc570.h:
#defineCONFIG_AT91_LEGACY
and
#defineCONFIG_AT91_GPIO1Quoted 8 lines
Quoted 3 lines
Should I send a patch to fix this, or should I wait for Jens patches coming mainline?
Please send a patch.
It should be a 2-3 liner.
I will combine it with Jens' patchset and push them together. Tom
Quoted 5 lines
You probably recognized that I did not sent a patch with
CONFIG_AT91_LEGACYsupport but I updated the otc570 board to new SoC access.
http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
I guess, this is the best solution.
Yes.
This is a better solution.
Thanks
Tom
Quoted 2 lines
Best regards,
Daniel Gorsulowski
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
In reply to Daniel GorsulowskiQuoted 48 lines · Daniel Gorsulowski
Quoted 39 lines · Tom
Quoted 38 lines · Daniel Gorsulowski
Hello Tom,
Quoted 29 lines · Tom
Quoted 7 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.Signed-off-by Jens Scharsig <[email protected]>This looks good.
The only problem is the new at91 target otc570 is breaking.Please take a look at errors in otc570
otc570 :
at91sam9263_devices.c: In function 'at91_serial0_hw_init':
at91sam9263_devices.c:40: warning: implicit declaration of function 'at91_set_a_periph'at91sam9263_devices.c: In function 'at91_spi0_hw_init':
at91sam9263_devices.c:96: warning: implicit declaration of function 'at91_set_b_periph'
at91sam9263_devices.c:116: warning: implicit declaration of function 'at91_set_pio_output'clock.c: In function 'at91_clock_init':
clock.c:160: warning: implicit declaration of function 'at91_sys_read' clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function) clock.c:160: error: (Each undeclared identifier is reported only once clock.c:160: error: for each function it appears in.)Quoted 1 line
Tom
This is caused by missing defines in include\configs\otc570.h:
#defineCONFIG_AT91_LEGACY
and
#defineCONFIG_AT91_GPIO1Quoted 8 lines
Quoted 3 lines
Should I send a patch to fix this, or should I wait for Jens patches coming mainline?
Please send a patch.
It should be a 2-3 liner.
I will combine it with Jens' patchset and push them together. Tom
Quoted 5 lines
You probably recognized that I did not sent a patch with
CONFIG_AT91_LEGACYsupport but I updated the otc570 board to new SoC access.
http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
I guess, this is the best solution.
Daniel,
I still see an error wrt otc570.
Jens,
I have pushed your patchset of around 2/4 to arm/master.
There will be an error in the otc570 build.
Tom
Quoted 2 lines
Best regards,
Daniel Gorsulowski
PATCH v4 1/9 add new CONFIG_AT91_LEGACY
Quoted 11 lines · Tom
Quoted 10 lines · Daniel Gorsulowski
Quoted 9 lines · Tom
Quoted 8 lines · Daniel Gorsulowski
Hello Tom,
Quoted 5 lines · Tom
Quoted 4 lines · Jens Scharsig
* add's the new temporary
CONFIG_AT91_LEGACYto all board configs This will need for backward compatiblity, while change the SoC access to c structures. IfCONFIG_AT91_LEGACYis defined, the deprecated SoC is used.
...
Quoted 6 lines
Quoted 5 lines
You probably recognized that I did not sent a patch with
CONFIG_AT91_LEGACYsupport but I updated the otc570 board to new SoC access.
http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
I guess, this is the best solution.
Quoted 9 lines
Daniel,
I still see an error wrt otc570.Jens,
I have pushed your patchset of around 2/4 to arm/master.There will be an error in the otc570 build.
Tom
If you are talking about errors in clock.c, I know about them. Please take a look at the comments in my otc570 patch. Regarding to Jens
Quoted 4 lines · patchset I
Apart from a tiny change, I give them an ACK. See
http://lists.denx.de/pipermail/u-boot/2010-February/067674.html
and
http://lists.denx.de/pipermail/u-boot/2010-February/067680.html
Best regards
Daniel Gorsulowski