diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2005-11-01 14:53:50 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-01 14:53:50 -0500 |
commit | d01e8897fcf597f62d84f626fdced8d94c70deaf (patch) | |
tree | 72e25f7df9b10aec46ccca594414f91eef092860 /include/asm-arm/arch-ixp2000/uengine.h | |
parent | fadab0943d1c5b652a66858bb99b204fedaad96b (diff) |
[ARM] 3052/1: add ixp2000 microcode loader
Patch from Lennert Buytenhek
This patch adds a microcode loader for the ixp2000 architecture.
The ixp2000 is an xscale-based CPU with a number of additional small
CPUs ('microengines') on die that can be programmed to do various
things. Depending on the ixp2000 model, there are between 2 and 16
microengines.
This code provides an API that allows configuring the microengines,
loading code into them, and starting and stopping them and reading
out a number of status registers, and is used by the microengine
network driver that was recently announced to netdev.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-ixp2000/uengine.h')
-rw-r--r-- | include/asm-arm/arch-ixp2000/uengine.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/asm-arm/arch-ixp2000/uengine.h b/include/asm-arm/arch-ixp2000/uengine.h new file mode 100644 index 000000000000..b442d65c6593 --- /dev/null +++ b/include/asm-arm/arch-ixp2000/uengine.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Generic library functions for the microengines found on the Intel | ||
3 | * IXP2000 series of network processors. | ||
4 | * | ||
5 | * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * Dedicated to Marija Kulikova. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU Lesser General Public License as | ||
10 | * published by the Free Software Foundation; either version 2.1 of the | ||
11 | * License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __IXP2000_UENGINE_H | ||
15 | #define __IXP2000_UENGINE_H | ||
16 | |||
17 | extern u32 ixp2000_uengine_mask; | ||
18 | |||
19 | struct ixp2000_uengine_code | ||
20 | { | ||
21 | u32 cpu_model_bitmask; | ||
22 | u8 cpu_min_revision; | ||
23 | u8 cpu_max_revision; | ||
24 | |||
25 | u32 uengine_parameters; | ||
26 | |||
27 | struct ixp2000_reg_value { | ||
28 | int reg; | ||
29 | u32 value; | ||
30 | } *initial_reg_values; | ||
31 | |||
32 | int num_insns; | ||
33 | u8 *insns; | ||
34 | }; | ||
35 | |||
36 | u32 ixp2000_uengine_csr_read(int uengine, int offset); | ||
37 | void ixp2000_uengine_csr_write(int uengine, int offset, u32 value); | ||
38 | void ixp2000_uengine_reset(u32 uengine_mask); | ||
39 | void ixp2000_uengine_set_mode(int uengine, u32 mode); | ||
40 | void ixp2000_uengine_load_microcode(int uengine, u8 *ucode, int insns); | ||
41 | void ixp2000_uengine_init_context(int uengine, int context, int pc); | ||
42 | void ixp2000_uengine_start_contexts(int uengine, u8 ctx_mask); | ||
43 | void ixp2000_uengine_stop_contexts(int uengine, u8 ctx_mask); | ||
44 | int ixp2000_uengine_load(int uengine, struct ixp2000_uengine_code *c); | ||
45 | |||
46 | #define IXP2000_UENGINE_8_CONTEXTS 0x00000000 | ||
47 | #define IXP2000_UENGINE_4_CONTEXTS 0x80000000 | ||
48 | #define IXP2000_UENGINE_PRN_UPDATE_EVERY 0x40000000 | ||
49 | #define IXP2000_UENGINE_PRN_UPDATE_ON_ACCESS 0x00000000 | ||
50 | #define IXP2000_UENGINE_NN_FROM_SELF 0x00100000 | ||
51 | #define IXP2000_UENGINE_NN_FROM_PREVIOUS 0x00000000 | ||
52 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_3 0x000c0000 | ||
53 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_2 0x00080000 | ||
54 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_1 0x00040000 | ||
55 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_0 0x00000000 | ||
56 | #define IXP2000_UENGINE_LM_ADDR1_GLOBAL 0x00020000 | ||
57 | #define IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT 0x00000000 | ||
58 | #define IXP2000_UENGINE_LM_ADDR0_GLOBAL 0x00010000 | ||
59 | #define IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT 0x00000000 | ||
60 | |||
61 | |||
62 | #endif | ||