[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
/ *
* Copyright ( C ) 2 0 0 4 - 2 0 0 6 A t m e l C o r p o r a t i o n
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
* /
/ *
* This f i l e c o n t a i n s t h e l o w - l e v e l e n t r y - p o i n t s i n t o t h e k e r n e l , t h a t i s ,
* exception h a n d l e r s , d e b u g t r a p h a n d l e r s , i n t e r r u p t h a n d l e r s a n d t h e
* system c a l l h a n d l e r .
* /
# include < l i n u x / e r r n o . h >
# include < a s m / a s m . h >
# include < a s m / h a r d i r q . h >
# include < a s m / i r q . h >
# include < a s m / o c d . h >
# include < a s m / p a g e . h >
# include < a s m / p g t a b l e . h >
# include < a s m / p t r a c e . h >
# include < a s m / s y s r e g . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / u n i s t d . h >
# ifdef C O N F I G _ P R E E M P T
# define p r e e m p t _ s t o p m a s k _ i n t e r r u p t s
# else
# define p r e e m p t _ s t o p
# define f a u l t _ r e s u m e _ k e r n e l f a u l t _ r e s t o r e _ a l l
# endif
# define _ _ M A S K ( x ) ( ( 1 < < ( x ) ) - 1 )
# define I R Q _ M A S K ( ( _ _ M A S K ( S O F T I R Q _ B I T S ) < < S O F T I R Q _ S H I F T ) | \
( _ _ MASK( H A R D I R Q _ B I T S ) < < H A R D I R Q _ S H I F T ) )
.section .ex .text , " ax" ,@progbits
.align 2
exception_vectors :
bral h a n d l e _ c r i t i c a l
.align 2
bral h a n d l e _ c r i t i c a l
.align 2
bral d o _ b u s _ e r r o r _ w r i t e
.align 2
bral d o _ b u s _ e r r o r _ r e a d
.align 2
bral d o _ n m i _ l l
.align 2
bral h a n d l e _ a d d r e s s _ f a u l t
.align 2
bral h a n d l e _ p r o t e c t i o n _ f a u l t
.align 2
bral h a n d l e _ d e b u g
.align 2
bral d o _ i l l e g a l _ o p c o d e _ l l
.align 2
bral d o _ i l l e g a l _ o p c o d e _ l l
.align 2
bral d o _ i l l e g a l _ o p c o d e _ l l
.align 2
bral d o _ f p e _ l l
.align 2
bral d o _ i l l e g a l _ o p c o d e _ l l
.align 2
bral h a n d l e _ a d d r e s s _ f a u l t
.align 2
bral h a n d l e _ a d d r e s s _ f a u l t
.align 2
bral h a n d l e _ p r o t e c t i o n _ f a u l t
.align 2
bral h a n d l e _ p r o t e c t i o n _ f a u l t
.align 2
bral d o _ d t l b _ m o d i f i e d
/ *
* r0 : P G D / P T / P T E
* r1 : O f f e n d i n g a d d r e s s
* r2 : S c r a t c h r e g i s t e r
* r3 : C a u s e ( 5 , 1 2 o r 1 3 )
* /
# define t l b m i s s _ s a v e p u s h m r0 - r3
# define t l b m i s s _ r e s t o r e p o p m r0 - r3
.section .tlbx .ex .text , " ax" ,@progbits
.global itlb_miss
itlb_miss :
tlbmiss_ s a v e
rjmp t l b _ m i s s _ c o m m o n
.section .tlbr .ex .text , " ax" ,@progbits
dtlb_miss_read :
tlbmiss_ s a v e
rjmp t l b _ m i s s _ c o m m o n
.section .tlbw .ex .text , " ax" ,@progbits
dtlb_miss_write :
tlbmiss_ s a v e
.global tlb_miss_common
tlb_miss_common :
2007-03-14 13:59:13 +01:00
mfsr r0 , S Y S R E G _ T L B E A R
mfsr r1 , S Y S R E G _ P T B R
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
/* Is it the vmalloc space? */
2007-03-14 13:59:13 +01:00
bld r0 , 3 1
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
brcs h a n d l e _ v m a l l o c _ m i s s
/* First level lookup */
pgtbl_lookup :
2007-03-14 13:59:13 +01:00
lsr r2 , r0 , P G D I R _ S H I F T
ld. w r3 , r1 [ r2 < < 2 ]
bfextu r1 , r0 , P A G E _ S H I F T , P G D I R _ S H I F T - P A G E _ S H I F T
bld r3 , _ P A G E _ B I T _ P R E S E N T
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
brcc p a g e _ t a b l e _ n o t _ p r e s e n t
/* Translate to virtual address in P1. */
2007-03-14 13:59:13 +01:00
andl r3 , 0 x f00 0
sbr r3 , 3 1
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
/* Second level lookup */
2007-03-14 13:59:13 +01:00
ld. w r2 , r3 [ r1 < < 2 ]
mfsr r0 , S Y S R E G _ T L B A R L O
bld r2 , _ P A G E _ B I T _ P R E S E N T
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
brcc p a g e _ n o t _ p r e s e n t
/* Mark the page as accessed */
2007-03-14 13:59:13 +01:00
sbr r2 , _ P A G E _ B I T _ A C C E S S E D
st. w r3 [ r1 < < 2 ] , r2
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
/* Drop software flags */
2007-03-14 13:59:13 +01:00
andl r2 , _ P A G E _ F L A G S _ H A R D W A R E _ M A S K & 0 x f f f f
mtsr S Y S R E G _ T L B E L O , r2
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
/* Figure out which entry we want to replace */
2007-03-14 13:59:13 +01:00
mfsr r1 , S Y S R E G _ M M U C R
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
clz r2 , r0
brcc 1 f
2007-03-14 13:59:13 +01:00
mov r3 , - 1 / * A l l e n t r i e s h a v e b e e n a c c e s s e d , * /
mov r2 , 0 / * s o s t a r t a t 0 * /
mtsr S Y S R E G _ T L B A R L O , r3 / * a n d r e s e t T L B A R * /
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
2007-03-14 13:59:13 +01:00
1 : bfins r1 , r2 , S Y S R E G _ D R P _ O F F S E T , S Y S R E G _ D R P _ S I Z E
mtsr S Y S R E G _ M M U C R , r1
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
tlbw
tlbmiss_ r e s t o r e
rete
handle_vmalloc_miss :
/* Simply do the lookup in init's page table */
2007-03-14 13:59:13 +01:00
mov r1 , l o ( s w a p p e r _ p g _ d i r )
orh r1 , h i ( s w a p p e r _ p g _ d i r )
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
rjmp p g t b l _ l o o k u p
/* --- System Call --- */
.section .scall .text , " ax" ,@progbits
system_call :
2007-10-10 18:52:24 -04:00
# ifdef C O N F I G _ P R E E M P T
mask_ i n t e r r u p t s
# endif
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
pushm r12 / * r12 _ o r i g * /
stmts - - s p , r0 - l r
2007-10-10 18:52:24 -04:00
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
mfsr r0 , S Y S R E G _ R A R _ S U P
mfsr r1 , S Y S R E G _ R S R _ S U P
2007-10-10 18:52:24 -04:00
# ifdef C O N F I G _ P R E E M P T
unmask_ i n t e r r u p t s
# endif
zero_ f p
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
stm - - s p , r0 - r1
/* check for syscall tracing */
get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
bld r1 , T I F _ S Y S C A L L _ T R A C E
brcs s y s c a l l _ t r a c e _ e n t e r
syscall_trace_cont :
cp. w r8 , N R _ s y s c a l l s
brhs s y s c a l l _ b a d s y s
lddpc l r , s y s c a l l _ t a b l e _ a d d r
ld. w l r , l r [ r8 < < 2 ]
mov r8 , r5 / * 5 t h a r g u m e n t ( 6 t h i s p u s h e d b y s t u b ) * /
icall l r
.global syscall_return
syscall_return :
get_ t h r e a d _ i n f o r0
mask_ i n t e r r u p t s / * m a k e s u r e w e d o n ' t m i s s a n i n t e r r u p t
setting n e e d _ r e s c h e d o r s i g p e n d i n g
between s a m p l i n g a n d t h e r e t s * /
/* Store the return value so that the correct value is loaded below */
stdsp s p [ R E G _ R 1 2 ] , r12
ld. w r1 , r0 [ T I _ f l a g s ]
andl r1 , _ T I F _ A L L W O R K _ M A S K , C O H
brne s y s c a l l _ e x i t _ w o r k
syscall_exit_cont :
popm r8 - r9
mtsr S Y S R E G _ R A R _ S U P , r8
mtsr S Y S R E G _ R S R _ S U P , r9
ldmts s p + + , r0 - l r
sub s p , - 4 / * r12 _ o r i g * /
rets
.align 2
syscall_table_addr :
.long sys_call_table
syscall_badsys :
mov r12 , - E N O S Y S
rjmp s y s c a l l _ r e t u r n
.global ret_from_fork
ret_from_fork :
rcall s c h e d u l e _ t a i l
/* check for syscall tracing */
get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
andl r1 , _ T I F _ A L L W O R K _ M A S K , C O H
brne s y s c a l l _ e x i t _ w o r k
rjmp s y s c a l l _ e x i t _ c o n t
syscall_trace_enter :
pushm r8 - r12
rcall s y s c a l l _ t r a c e
popm r8 - r12
rjmp s y s c a l l _ t r a c e _ c o n t
syscall_exit_work :
bld r1 , T I F _ S Y S C A L L _ T R A C E
brcc 1 f
unmask_ i n t e r r u p t s
rcall s y s c a l l _ t r a c e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
1 : bld r1 , T I F _ N E E D _ R E S C H E D
brcc 2 f
unmask_ i n t e r r u p t s
rcall s c h e d u l e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp 1 b
2 : mov r2 , _ T I F _ S I G P E N D I N G | _ T I F _ R E S T O R E _ S I G M A S K
tst r1 , r2
breq 3 f
unmask_ i n t e r r u p t s
mov r12 , s p
mov r11 , r0
rcall d o _ n o t i f y _ r e s u m e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp 1 b
3 : bld r1 , T I F _ B R E A K P O I N T
brcc s y s c a l l _ e x i t _ c o n t
mfsr r3 , S Y S R E G _ T L B E H I
lddsp r2 , s p [ R E G _ P C ]
andl r3 , 0 x f f , C O H
lsl r3 , 1
sbr r3 , 3 0
sbr r3 , 0
mtdr D B G R E G _ B W A 2 A , r2
mtdr D B G R E G _ B W C 2 A , r3
rjmp s y s c a l l _ e x i t _ c o n t
/* The slow path of the TLB miss handler */
page_table_not_present :
page_not_present :
tlbmiss_ r e s t o r e
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ p a g e _ f a u l t
rjmp r e t _ f r o m _ e x c e p t i o n
/* This function expects to find offending PC in SYSREG_RAR_EX */
save_full_context_ex :
mfsr r8 , S Y S R E G _ R S R _ E X
mov r12 , r8
andh r8 , ( M O D E _ M A S K > > 1 6 ) , C O H
mfsr r11 , S Y S R E G _ R A R _ E X
brne 2 f
1 : pushm r11 , r12 / * P C a n d S R * /
unmask_ e x c e p t i o n s
ret r12
2 : sub r10 , s p , - ( F R A M E _ S I Z E _ F U L L - R E G _ L R )
stdsp s p [ 4 ] , r10 / * r e p l a c e s a v e d S P * /
rjmp 1 b
/* Low-level exception handlers */
handle_critical :
pushm r12
pushm r0 - r12
rcall s a v e _ f u l l _ c o n t e x t _ e x
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ c r i t i c a l _ e x c e p t i o n
/* We should never get here... */
bad_return :
sub r12 , p c , ( . - 1 f )
bral p a n i c
.align 2
1 : .asciz " Return from critical exception! "
.align 1
do_bus_error_write :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mov r11 , 1
rjmp 1 f
do_bus_error_read :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mov r11 , 0
1 : mfsr r12 , S Y S R E G _ B E A R
mov r10 , s p
rcall d o _ b u s _ e r r o r
rjmp r e t _ f r o m _ e x c e p t i o n
.align 1
do_nmi_ll :
sub s p , 4
stmts - - s p , r0 - l r
2007-03-13 10:06:37 +01:00
mfsr r9 , S Y S R E G _ R S R _ N M I
mfsr r8 , S Y S R E G _ R A R _ N M I
bfextu r0 , r9 , M O D E _ S H I F T , 3
brne 2 f
1 : pushm r8 , r9 / * P C a n d S R * /
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ n m i
2007-03-13 10:06:37 +01:00
popm r8 - r9
mtsr S Y S R E G _ R A R _ N M I , r8
tst r0 , r0
mtsr S Y S R E G _ R S R _ N M I , r9
brne 3 f
ldmts s p + + , r0 - l r
sub s p , - 4 / * s k i p r12 _ o r i g * /
rete
2 : sub r10 , s p , - ( F R A M E _ S I Z E _ F U L L - R E G _ L R )
stdsp s p [ 4 ] , r10 / * r e p l a c e s a v e d S P * /
rjmp 1 b
3 : popm l r
sub s p , - 4 / * s k i p s p * /
popm r0 - r12
sub s p , - 4 / * s k i p r12 _ o r i g * /
rete
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
handle_address_fault :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ a d d r e s s _ e x c e p t i o n
rjmp r e t _ f r o m _ e x c e p t i o n
handle_protection_fault :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ p a g e _ f a u l t
rjmp r e t _ f r o m _ e x c e p t i o n
.align 1
do_illegal_opcode_ll :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
mfsr r12 , S Y S R E G _ E C R
mov r11 , s p
rcall d o _ i l l e g a l _ o p c o d e
rjmp r e t _ f r o m _ e x c e p t i o n
do_dtlb_modified :
pushm r0 - r3
mfsr r1 , S Y S R E G _ T L B E A R
mfsr r0 , S Y S R E G _ P T B R
lsr r2 , r1 , P G D I R _ S H I F T
ld. w r0 , r0 [ r2 < < 2 ]
lsl r1 , ( 3 2 - P G D I R _ S H I F T )
lsr r1 , ( 3 2 - P G D I R _ S H I F T ) + P A G E _ S H I F T
/* Translate to virtual address in P1 */
andl r0 , 0 x f00 0
sbr r0 , 3 1
add r2 , r0 , r1 < < 2
ld. w r3 , r2 [ 0 ]
sbr r3 , _ P A G E _ B I T _ D I R T Y
mov r0 , r3
st. w r2 [ 0 ] , r3
/* The page table is up-to-date. Update the TLB entry as well */
andl r0 , l o ( _ P A G E _ F L A G S _ H A R D W A R E _ M A S K )
mtsr S Y S R E G _ T L B E L O , r0
/* MMUCR[DRP] is updated automatically, so let's go... */
tlbw
popm r0 - r3
rete
do_fpe_ll :
sub s p , 4
stmts - - s p , r0 - l r
rcall s a v e _ f u l l _ c o n t e x t _ e x
unmask_ i n t e r r u p t s
mov r12 , 2 6
mov r11 , s p
rcall d o _ f p e
rjmp r e t _ f r o m _ e x c e p t i o n
ret_from_exception :
mask_ i n t e r r u p t s
lddsp r4 , s p [ R E G _ S R ]
andh r4 , ( M O D E _ M A S K > > 1 6 ) , C O H
brne f a u l t _ r e s u m e _ k e r n e l
get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
andl r1 , _ T I F _ W O R K _ M A S K , C O H
brne f a u l t _ e x i t _ w o r k
fault_resume_user :
popm r8 - r9
mask_ e x c e p t i o n s
mtsr S Y S R E G _ R A R _ E X , r8
mtsr S Y S R E G _ R S R _ E X , r9
ldmts s p + + , r0 - l r
sub s p , - 4
rete
fault_resume_kernel :
# ifdef C O N F I G _ P R E E M P T
get_ t h r e a d _ i n f o r0
ld. w r2 , r0 [ T I _ p r e e m p t _ c o u n t ]
cp. w r2 , 0
brne 1 f
ld. w r1 , r0 [ T I _ f l a g s ]
bld r1 , T I F _ N E E D _ R E S C H E D
brcc 1 f
lddsp r4 , s p [ R E G _ S R ]
bld r4 , S Y S R E G _ G M _ O F F S E T
brcs 1 f
rcall p r e e m p t _ s c h e d u l e _ i r q
1 :
# endif
popm r8 - r9
mask_ e x c e p t i o n s
mfsr r1 , S Y S R E G _ S R
mtsr S Y S R E G _ R A R _ E X , r8
mtsr S Y S R E G _ R S R _ E X , r9
popm l r
sub s p , - 4 / * i g n o r e S P * /
popm r0 - r12
sub s p , - 4 / * i g n o r e r12 _ o r i g * /
rete
irq_exit_work :
/* Switch to exception mode so that we can share the same code. */
mfsr r8 , S Y S R E G _ S R
cbr r8 , S Y S R E G _ M 0 _ O F F S E T
orh r8 , h i ( S Y S R E G _ B I T ( M 1 ) | S Y S R E G _ B I T ( M 2 ) )
mtsr S Y S R E G _ S R , r8
sub p c , - 2
get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
fault_exit_work :
bld r1 , T I F _ N E E D _ R E S C H E D
brcc 1 f
unmask_ i n t e r r u p t s
rcall s c h e d u l e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp f a u l t _ e x i t _ w o r k
1 : mov r2 , _ T I F _ S I G P E N D I N G | _ T I F _ R E S T O R E _ S I G M A S K
tst r1 , r2
breq 2 f
unmask_ i n t e r r u p t s
mov r12 , s p
mov r11 , r0
rcall d o _ n o t i f y _ r e s u m e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp f a u l t _ e x i t _ w o r k
2 : bld r1 , T I F _ B R E A K P O I N T
brcc f a u l t _ r e s u m e _ u s e r
mfsr r3 , S Y S R E G _ T L B E H I
lddsp r2 , s p [ R E G _ P C ]
andl r3 , 0 x f f , C O H
lsl r3 , 1
sbr r3 , 3 0
sbr r3 , 0
mtdr D B G R E G _ B W A 2 A , r2
mtdr D B G R E G _ B W C 2 A , r3
rjmp f a u l t _ r e s u m e _ u s e r
/* If we get a debug trap from privileged context we end up here */
handle_debug_priv :
/* Fix up LR and SP in regs. r11 contains the mode we came from */
mfsr r8 , S Y S R E G _ S R
mov r9 , r8
andh r8 , h i ( ~ M O D E _ M A S K )
or r8 , r11
mtsr S Y S R E G _ S R , r8
sub p c , - 2
stdsp s p [ R E G _ L R ] , l r
mtsr S Y S R E G _ S R , r9
sub p c , - 2
sub r10 , s p , - F R A M E _ S I Z E _ F U L L
stdsp s p [ R E G _ S P ] , r10
mov r12 , s p
rcall d o _ d e b u g _ p r i v
/* Now, put everything back */
ssrf S R _ E M _ B I T
popm r10 , r11
mtsr S Y S R E G _ R A R _ D B G , r10
mtsr S Y S R E G _ R S R _ D B G , r11
mfsr r8 , S Y S R E G _ S R
mov r9 , r8
andh r8 , h i ( ~ M O D E _ M A S K )
andh r11 , h i ( M O D E _ M A S K )
or r8 , r11
mtsr S Y S R E G _ S R , r8
sub p c , - 2
popm l r
mtsr S Y S R E G _ S R , r9
sub p c , - 2
sub s p , - 4 / * s k i p S P * /
popm r0 - r12
sub s p , - 4
retd
/ *
* At t h i s p o i n t , e v e r y t h i n g i s m a s k e d , t h a t i s , i n t e r r u p t s ,
* exceptions a n d d e b u g g i n g t r a p s . W e m i g h t g e t c a l l e d f r o m
* interrupt o r e x c e p t i o n c o n t e x t i n s o m e r a r e c a s e s , b u t t h i s
* will b e t a k e n c a r e o f b y d o _ d e b u g ( ) , s o w e ' r e n o t g o i n g t o
* do a 1 0 0 % c o r r e c t c o n t e x t s a v e h e r e .
* /
handle_debug :
sub s p , 4 / * r12 _ o r i g * /
stmts - - s p , r0 - l r
mfsr r10 , S Y S R E G _ R A R _ D B G
mfsr r11 , S Y S R E G _ R S R _ D B G
unmask_ e x c e p t i o n s
pushm r10 ,r11
andh r11 , ( M O D E _ M A S K > > 1 6 ) , C O H
brne h a n d l e _ d e b u g _ p r i v
mov r12 , s p
rcall d o _ d e b u g
lddsp r10 , s p [ R E G _ S R ]
andh r10 , ( M O D E _ M A S K > > 1 6 ) , C O H
breq d e b u g _ r e s u m e _ u s e r
debug_restore_all :
popm r10 ,r11
mask_ e x c e p t i o n s
mtsr S Y S R E G _ R S R _ D B G , r11
mtsr S Y S R E G _ R A R _ D B G , r10
ldmts s p + + , r0 - l r
sub s p , - 4
retd
debug_resume_user :
get_ t h r e a d _ i n f o r0
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
andl r1 , _ T I F _ D B G W O R K _ M A S K , C O H
breq d e b u g _ r e s t o r e _ a l l
1 : bld r1 , T I F _ N E E D _ R E S C H E D
brcc 2 f
unmask_ i n t e r r u p t s
rcall s c h e d u l e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp 1 b
2 : mov r2 , _ T I F _ S I G P E N D I N G | _ T I F _ R E S T O R E _ S I G M A S K
tst r1 , r2
breq 3 f
unmask_ i n t e r r u p t s
mov r12 , s p
mov r11 , r0
rcall d o _ n o t i f y _ r e s u m e
mask_ i n t e r r u p t s
ld. w r1 , r0 [ T I _ f l a g s ]
rjmp 1 b
3 : bld r1 , T I F _ S I N G L E _ S T E P
brcc d e b u g _ r e s t o r e _ a l l
mfdr r2 , D B G R E G _ D C
sbr r2 , D C _ S S _ B I T
mtdr D B G R E G _ D C , r2
rjmp d e b u g _ r e s t o r e _ a l l
.set rsr_ i n t 0 , S Y S R E G _ R S R _ I N T 0
.set rsr_ i n t 1 , S Y S R E G _ R S R _ I N T 1
.set rsr_ i n t 2 , S Y S R E G _ R S R _ I N T 2
.set rsr_ i n t 3 , S Y S R E G _ R S R _ I N T 3
.set rar_ i n t 0 , S Y S R E G _ R A R _ I N T 0
.set rar_ i n t 1 , S Y S R E G _ R A R _ I N T 1
.set rar_ i n t 2 , S Y S R E G _ R A R _ I N T 2
.set rar_ i n t 3 , S Y S R E G _ R A R _ I N T 3
.macro IRQ_LEVEL level
.type irq_ l e v e l \ l e v e l , @function
irq_ l e v e l \ l e v e l :
sub s p , 4 / * r12 _ o r i g * /
stmts - - s p ,r0 - l r
mfsr r8 , r a r _ i n t \ l e v e l
mfsr r9 , r s r _ i n t \ l e v e l
2007-10-10 18:52:24 -04:00
# ifdef C O N F I G _ P R E E M P T
sub r11 , p c , ( . - s y s t e m _ c a l l )
cp. w r11 , r8
breq 4 f
# endif
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
pushm r8 - r9
mov r11 , s p
mov r12 , \ l e v e l
rcall d o _ I R Q
lddsp r4 , s p [ R E G _ S R ]
2007-02-26 13:50:43 +01:00
bfextu r4 , r4 , S Y S R E G _ M 0 _ O F F S E T , 3
cp. w r4 , M O D E _ S U P E R V I S O R > > S Y S R E G _ M 0 _ O F F S E T
breq 2 f
cp. w r4 , M O D E _ U S E R > > S Y S R E G _ M 0 _ O F F S E T
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
# ifdef C O N F I G _ P R E E M P T
2007-02-26 13:50:43 +01:00
brne 3 f
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
# else
brne 1 f
# endif
get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
andl r1 , _ T I F _ W O R K _ M A S K , C O H
brne i r q _ e x i t _ w o r k
1 : popm r8 - r9
mtsr r a r _ i n t \ l e v e l , r8
mtsr r s r _ i n t \ l e v e l , r9
ldmts s p + + ,r0 - l r
sub s p , - 4 / * i g n o r e r12 _ o r i g * /
rete
2007-10-10 18:52:24 -04:00
# ifdef C O N F I G _ P R E E M P T
4 : mask_ i n t e r r u p t s
mfsr r8 , r s r _ i n t \ l e v e l
sbr r8 , 1 6
mtsr r s r _ i n t \ l e v e l , r8
ldmts s p + + , r0 - l r
sub s p , - 4 / * i g n o r e r12 _ o r i g * /
rete
# endif
2007-02-26 13:50:43 +01:00
2 : get_ t h r e a d _ i n f o r0
ld. w r1 , r0 [ T I _ f l a g s ]
bld r1 , T I F _ C P U _ G O I N G _ T O _ S L E E P
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
# ifdef C O N F I G _ P R E E M P T
2007-02-26 13:50:43 +01:00
brcc 3 f
# else
brcc 1 b
# endif
sub r1 , p c , . - c p u _ i d l e _ s k i p _ s l e e p
stdsp s p [ R E G _ P C ] , r1
# ifdef C O N F I G _ P R E E M P T
3 : get_ t h r e a d _ i n f o r0
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
ld. w r2 , r0 [ T I _ p r e e m p t _ c o u n t ]
cp. w r2 , 0
brne 1 b
ld. w r1 , r0 [ T I _ f l a g s ]
bld r1 , T I F _ N E E D _ R E S C H E D
brcc 1 b
lddsp r4 , s p [ R E G _ S R ]
bld r4 , S Y S R E G _ G M _ O F F S E T
brcs 1 b
rcall p r e e m p t _ s c h e d u l e _ i r q
# endif
2007-02-26 13:50:43 +01:00
rjmp 1 b
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
.endm
.section .irq .text , " ax" ,@progbits
2007-02-26 13:50:43 +01:00
.global cpu_idle_sleep
cpu_idle_sleep :
mask_ i n t e r r u p t s
get_ t h r e a d _ i n f o r8
ld. w r9 , r8 [ T I _ f l a g s ]
bld r9 , T I F _ N E E D _ R E S C H E D
brcs c p u _ i d l e _ e n a b l e _ i n t _ a n d _ e x i t
sbr r9 , T I F _ C P U _ G O I N G _ T O _ S L E E P
st. w r8 [ T I _ f l a g s ] , r9
unmask_ i n t e r r u p t s
sleep 0
cpu_idle_skip_sleep :
mask_ i n t e r r u p t s
ld. w r9 , r8 [ T I _ f l a g s ]
cbr r9 , T I F _ C P U _ G O I N G _ T O _ S L E E P
st. w r8 [ T I _ f l a g s ] , r9
cpu_idle_enable_int_and_exit :
unmask_ i n t e r r u p t s
retal r12
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-25 23:32:13 -07:00
.global irq_level0
.global irq_level1
.global irq_level2
.global irq_level3
IRQ_ L E V E L 0
IRQ_ L E V E L 1
IRQ_ L E V E L 2
IRQ_ L E V E L 3