aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2009-07-17 08:39:23 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-09-19 16:15:26 -0400
commitfc28c39f0ef59bfb649ddfd633275be8e45c0f9c (patch)
tree7a1e8d0b1bc015b5cc9584db3ac7805269036479 /Documentation
parent223cf6c3b517cf6ef040cafe45af89f3b8adba74 (diff)
mtd: maps: add mtd-ram support to physmap_of
Use physmap_of to access RAMs as mtd and add documenation for it. This approach is a lot less intrusive as adding an of-wrapper around plat-ram.c. As most extensions of plat-ram.c (e.g. custom map-functions) can't be mapped to the device tree anyhow, extending physmap_of seems to be the cleanest approach. Tested with a phyCORE-MPC5121e. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Vitaly Wool <vwool@ru.mvista.com> Cc: Artem Bityutskiy <dedekind@infradead.org> Cc: Ken MacLeod <ken@bitsko.slc.ut.us> Cc: Albrecht Dreß <albrecht.dress@arcor.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/powerpc/dts-bindings/mtd-physmap.txt42
1 files changed, 26 insertions, 16 deletions
diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
index 667c9bde8699..80152cb567d9 100644
--- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt
+++ b/Documentation/powerpc/dts-bindings/mtd-physmap.txt
@@ -1,18 +1,19 @@
1CFI or JEDEC memory-mapped NOR flash 1CFI or JEDEC memory-mapped NOR flash, MTD-RAM (NVRAM...)
2 2
3Flash chips (Memory Technology Devices) are often used for solid state 3Flash chips (Memory Technology Devices) are often used for solid state
4file systems on embedded devices. 4file systems on embedded devices.
5 5
6 - compatible : should contain the specific model of flash chip(s) 6 - compatible : should contain the specific model of mtd chip(s)
7 used, if known, followed by either "cfi-flash" or "jedec-flash" 7 used, if known, followed by either "cfi-flash", "jedec-flash"
8 - reg : Address range(s) of the flash chip(s) 8 or "mtd-ram".
9 - reg : Address range(s) of the mtd chip(s)
9 It's possible to (optionally) define multiple "reg" tuples so that 10 It's possible to (optionally) define multiple "reg" tuples so that
10 non-identical NOR chips can be described in one flash node. 11 non-identical chips can be described in one node.
11 - bank-width : Width (in bytes) of the flash bank. Equal to the 12 - bank-width : Width (in bytes) of the bank. Equal to the
12 device width times the number of interleaved chips. 13 device width times the number of interleaved chips.
13 - device-width : (optional) Width of a single flash chip. If 14 - device-width : (optional) Width of a single mtd chip. If
14 omitted, assumed to be equal to 'bank-width'. 15 omitted, assumed to be equal to 'bank-width'.
15 - #address-cells, #size-cells : Must be present if the flash has 16 - #address-cells, #size-cells : Must be present if the device has
16 sub-nodes representing partitions (see below). In this case 17 sub-nodes representing partitions (see below). In this case
17 both #address-cells and #size-cells must be equal to 1. 18 both #address-cells and #size-cells must be equal to 1.
18 19
@@ -22,24 +23,24 @@ are defined:
22 - vendor-id : Contains the flash chip's vendor id (1 byte). 23 - vendor-id : Contains the flash chip's vendor id (1 byte).
23 - device-id : Contains the flash chip's device id (1 byte). 24 - device-id : Contains the flash chip's device id (1 byte).
24 25
25In addition to the information on the flash bank itself, the 26In addition to the information on the mtd bank itself, the
26device tree may optionally contain additional information 27device tree may optionally contain additional information
27describing partitions of the flash address space. This can be 28describing partitions of the address space. This can be
28used on platforms which have strong conventions about which 29used on platforms which have strong conventions about which
29portions of the flash are used for what purposes, but which don't 30portions of a flash are used for what purposes, but which don't
30use an on-flash partition table such as RedBoot. 31use an on-flash partition table such as RedBoot.
31 32
32Each partition is represented as a sub-node of the flash device. 33Each partition is represented as a sub-node of the mtd device.
33Each node's name represents the name of the corresponding 34Each node's name represents the name of the corresponding
34partition of the flash device. 35partition of the mtd device.
35 36
36Flash partitions 37Flash partitions
37 - reg : The partition's offset and size within the flash bank. 38 - reg : The partition's offset and size within the mtd bank.
38 - label : (optional) The label / name for this flash partition. 39 - label : (optional) The label / name for this partition.
39 If omitted, the label is taken from the node name (excluding 40 If omitted, the label is taken from the node name (excluding
40 the unit address). 41 the unit address).
41 - read-only : (optional) This parameter, if present, is a hint to 42 - read-only : (optional) This parameter, if present, is a hint to
42 Linux that this flash partition should only be mounted 43 Linux that this partition should only be mounted
43 read-only. This is usually used for flash partitions 44 read-only. This is usually used for flash partitions
44 containing early-boot firmware images or data which should not 45 containing early-boot firmware images or data which should not
45 be clobbered. 46 be clobbered.
@@ -78,3 +79,12 @@ Here an example with multiple "reg" tuples:
78 reg = <0 0x04000000>; 79 reg = <0 0x04000000>;
79 }; 80 };
80 }; 81 };
82
83An example using SRAM:
84
85 sram@2,0 {
86 compatible = "samsung,k6f1616u6a", "mtd-ram";
87 reg = <2 0 0x00200000>;
88 bank-width = <2>;
89 };
90
pan>
4be44fcd3bf6



1da177e4c3f4



4be44fcd3bf6
1da177e4c3f4

4be44fcd3bf6

1da177e4c3f4


4be44fcd3bf6




1da177e4c3f4

4be44fcd3bf6
1da177e4c3f4





4be44fcd3bf6







1da177e4c3f4

1da177e4c3f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278


                          
                      
 
                     








                                                         
                                           









                                                                               



                            





                      
                           
                                 
                  
                                        



                          

                          





                          
                 




                                                  


                                         



                                                                  






                                    
                          





                      

                           




                                                                  
  
                                   
                                    
                                                  
                                 
                                         

                                            
  

                          
                        

                                  



                        




                                                                       
                                                      

                             
                                                           
                                                                   
                                                        
  
                             






                              

                       



                                       



                                                       

                                                         

                              
               
                



                              
  

                                                                 




                                                                                



                                                                    
                                                                             
                                                  
                                           
                                                             
 
                          
                                                                           
                                                          
     

                                                                               




                            
                            
 



                                                              








                                                                           
                                         


                                                                                               


                             
                                                     
                               
                                                                        

                                                             



                                                              
                            
                                                             




                                                        






                                                  
      
      
#ifndef __ACPI_PROCESSOR_H
#define __ACPI_PROCESSOR_H

#include <linux/kernel.h>
#include <linux/cpu.h>

#include <asm/acpi.h>

#define ACPI_PROCESSOR_BUSY_METRIC	10

#define ACPI_PROCESSOR_MAX_POWER	8
#define ACPI_PROCESSOR_MAX_C2_LATENCY	100
#define ACPI_PROCESSOR_MAX_C3_LATENCY	1000

#define ACPI_PROCESSOR_MAX_THROTTLING	16
#define ACPI_PROCESSOR_MAX_THROTTLE	250	/* 25% */
#define ACPI_PROCESSOR_MAX_DUTY_WIDTH	4

#define ACPI_PDC_REVISION_ID		0x1

#define ACPI_PSD_REV0_REVISION		0 /* Support for _PSD as in ACPI 3.0 */
#define ACPI_PSD_REV0_ENTRIES		5

/*
 * Types of coordination defined in ACPI 3.0. Same macros can be used across
 * P, C and T states
 */
#define DOMAIN_COORD_TYPE_SW_ALL	0xfc
#define DOMAIN_COORD_TYPE_SW_ANY	0xfd
#define DOMAIN_COORD_TYPE_HW_ALL	0xfe

/* Power Management */

struct acpi_processor_cx;

struct acpi_power_register {
	u8 descriptor;
	u16 length;
	u8 space_id;
	u8 bit_width;
	u8 bit_offset;
	u8 reserved;
	u64 address;
} __attribute__ ((packed));

struct acpi_processor_cx_policy {
	u32 count;
	struct acpi_processor_cx *state;
	struct {
		u32 time;
		u32 ticks;
		u32 count;
		u32 bm;
	} threshold;
};

struct acpi_processor_cx {
	u8 valid;
	u8 type;
	u32 address;
	u32 latency;
	u32 latency_ticks;
	u32 power;
	u32 usage;
	u64 time;
	struct acpi_processor_cx_policy promotion;
	struct acpi_processor_cx_policy demotion;
};

struct acpi_processor_power {
	struct acpi_processor_cx *state;
	unsigned long bm_check_timestamp;
	u32 default_state;
	u32 bm_activity;
	int count;
	struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
};

/* Performance Management */

struct acpi_psd_package {
	acpi_integer num_entries;
	acpi_integer revision;
	acpi_integer domain;
	acpi_integer coord_type;
	acpi_integer num_processors;
} __attribute__ ((packed));

struct acpi_pct_register {
	u8 descriptor;
	u16 length;
	u8 space_id;
	u8 bit_width;
	u8 bit_offset;
	u8 reserved;
	u64 address;
} __attribute__ ((packed));

struct acpi_processor_px {
	acpi_integer core_frequency;	/* megahertz */
	acpi_integer power;	/* milliWatts */
	acpi_integer transition_latency;	/* microseconds */
	acpi_integer bus_master_latency;	/* microseconds */
	acpi_integer control;	/* control value */
	acpi_integer status;	/* success indicator */
};

struct acpi_processor_performance {
	unsigned int state;
	unsigned int platform_limit;
	struct acpi_pct_register control_register;
	struct acpi_pct_register status_register;
	unsigned int state_count;
	struct acpi_processor_px *states;
	struct acpi_psd_package domain_info;
	cpumask_t shared_cpu_map;
	unsigned int shared_type;
};

/* Throttling Control */

struct acpi_processor_tx {
	u16 power;
	u16 performance;
};

struct acpi_processor_throttling {
	int state;
	u32 address;
	u8 duty_offset;
	u8 duty_width;
	int state_count;
	struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
};

/* Limit Interface */

struct acpi_processor_lx {
	int px;			/* performace state */
	int tx;			/* throttle level */
};

struct acpi_processor_limit {
	struct acpi_processor_lx state;	/* current limit */
	struct acpi_processor_lx thermal;	/* thermal limit */
	struct acpi_processor_lx user;	/* user limit */
};

struct acpi_processor_flags {
	u8 power:1;
	u8 performance:1;
	u8 throttling:1;
	u8 limit:1;
	u8 bm_control:1;
	u8 bm_check:1;
	u8 has_cst:1;
	u8 power_setup_done:1;
};

struct acpi_processor {
	acpi_handle handle;
	u32 acpi_id;
	u32 id;
	u32 pblk;
	int performance_platform_limit;
	struct acpi_processor_flags flags;
	struct acpi_processor_power power;
	struct acpi_processor_performance *performance;
	struct acpi_processor_throttling throttling;
	struct acpi_processor_limit limit;

	/* the _PDC objects for this processor, if any */
	struct acpi_object_list *pdc;
};

struct acpi_processor_errata {
	u8 smp;
	struct {
		u8 throttle:1;
		u8 fdma:1;
		u8 reserved:6;
		u32 bmisx;
	} piix4;
};

extern int acpi_processor_preregister_performance(
		struct acpi_processor_performance **performance);

extern int acpi_processor_register_performance(struct acpi_processor_performance
					       *performance, unsigned int cpu);
extern void acpi_processor_unregister_performance(struct
						  acpi_processor_performance
						  *performance,
						  unsigned int cpu);

/* note: this locks both the calling module and the processor module
         if a _PPC object exists, rmmod is disallowed then */
int acpi_processor_notify_smm(struct module *calling_module);

/* for communication between multiple parts of the processor kernel module */
extern struct acpi_processor *processors[NR_CPUS];
extern struct acpi_processor_errata errata;

void arch_acpi_processor_init_pdc(struct acpi_processor *pr);

#ifdef ARCH_HAS_POWER_INIT
void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
					unsigned int cpu);
#else
static inline void acpi_processor_power_init_bm_check(struct
						      acpi_processor_flags
						      *flags, unsigned int cpu)
{
	flags->bm_check = 1;
	return;
}
#endif

/* in processor_perflib.c */

#ifdef CONFIG_CPU_FREQ
void acpi_processor_ppc_init(void);
void acpi_processor_ppc_exit(void);
int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
#else
static inline void acpi_processor_ppc_init(void)
{
	return;
}
static inline void acpi_processor_ppc_exit(void)
{
	return;
}
static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
{
	static unsigned int printout = 1;
	if (printout) {
		printk(KERN_WARNING
		       "Warning: Processor Platform Limit event detected, but not handled.\n");
		printk(KERN_WARNING
		       "Consider compiling CPUfreq support into your kernel.\n");
		printout = 0;
	}
	return 0;
}
#endif				/* CONFIG_CPU_FREQ */

/* in processor_throttling.c */
int acpi_processor_get_throttling_info(struct acpi_processor *pr);
int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
extern struct file_operations acpi_processor_throttling_fops;

/* in processor_idle.c */
int acpi_processor_power_init(struct acpi_processor *pr,
			      struct acpi_device *device);
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
int acpi_processor_power_exit(struct acpi_processor *pr,
			      struct acpi_device *device);

/* in processor_thermal.c */
int acpi_processor_get_limit_info(struct acpi_processor *pr);
extern struct file_operations acpi_processor_limit_fops;

#ifdef CONFIG_CPU_FREQ
void acpi_thermal_cpufreq_init(void);
void acpi_thermal_cpufreq_exit(void);
#else
static inline void acpi_thermal_cpufreq_init(void)
{
	return;
}
static inline void acpi_thermal_cpufreq_exit(void)
{
	return;
}
#endif

#endif