1 /** @page dev_architecture Integrate a new architecture (ARCH)
3 @section linker_scripts Rules for the generic Linker Script File
5 Never include an object file by name directly! Linker Script Files defines the
6 layout, not the content. Content is defined in objecfiles instead.
8 Don't rely on the given object file order to create your binary U-Boot v2! This
9 may work, but is not relyable in all cases (and its a very bad style)!
11 For the special case some layout contraints exists, use specific section
12 naming instead. Refer @ref reset_code how to define this specific section.
14 @section reset_code Bring it up: The Reset Code
16 The way a CPU wakes up after reset is very specific to its architecture.
18 For example the ARM architecture starts its reset code at address 0x0000000,
19 the x86 architecture at 0x000FFFF0, PowerPC at 0x00000100 or 0xFFFFF100.
21 So for the special reset code on all architectures it must be located at
22 architecture specific locations within the binary U-Boot image.
24 All reset code uses section ".text_entry" for its localisation within the
25 binary U-Boot image. Its up to the linker script file to use this section name
26 to find the right place in whatever environment and U-Boot sizes.
29 .section ".text_entry","ax"
32 @section arch_files List of changes
34 - create a new subdirectory in /arch
39 /** @page dev_cpu Integrate a new CPU (MACH)
41 Features required for every CPU:
46 @section time_keeping Time keeping
48 In U-Boot-v2 we are using the clocksource mechanism from the Linux Kernel.
49 This makes it fairly easy to add timer functionality for a new board or
52 Apart from initialization there is only one function to be registerd:
53 clocksource_read(). This function returns the current value of a free running
54 counter. Other functions like udelay() and get_time_ns() are derived from this
55 function. The only thing you have to implement is a clocksource driver and
56 to register it at runtime.
59 static uint64_t mycpu_clocksource_read(void)
64 static struct clocksource cs = {
65 .read = mycpu_clocksource_read,
75 See arch/arm/mach-imx/clocksource.c for an example. clocksource drivers from
76 the Linux Kernel can be used nearly 1:1, except for the register accesses.
78 Note: For clocksources the __lshrdi3 symbol is needed. You can find the
79 function for your architecture in the Linux Kernel or a libc of your choice.
81 Note: U-Boot-v2 expects an upward counting counter!
83 @section reset_function Reset function
87 @li @subpage dev_arm_mach
88 @li @subpage dev_bf_mach
89 @li @subpage dev_ppc_mach
93 /** @page io_access_functions I/O access functions
95 List of functions to be used for hardware register access (I/O).
97 @section native_access Native IN/OUT access
99 @note Native means: It uses the same endianess than the CPU.
101 @subsection single_native_access Single access of various width
103 The following functions are intended to be used for a single I/O access.
105 To read a byte (8 bit) from a specific I/O address:
107 uint8_t readb(unsigned long)
110 To read a word (16 bit) from a specific I/O address:
112 uint16_t readw(unsigned long)
115 To read a long word (32 bit) from a specific I/O address:
117 uint32_t readl(unsigned long)
120 To write a byte (8 bit) into a specific I/O address:
122 void writeb(uint8_t val, unsigned long)
125 To write a word (16 bit) into a specific I/O address:
127 void writew(uint16_t val, unsigned long)
130 To write a long word (32 bit) into a specific I/O address:
132 void writel(uint32_t val, unsigned long)
135 @subsection string_native_access String native access of various width
137 The following functions are intended to be used for string based I/O access.
139 To read a string of bytes (8 bit) from one specific I/O address:
141 void readsb(const void __iomem *addr, void *mem_buffer, int byte_count);
144 To read a string of words (16 bit) from one specific I/O address:
146 void readsw(const void __iomem *addr, void *mem_buffer, int word_count);
149 To read a string of long words (32 bit) from one specific I/O address:
151 void readsl(const void __iomem *addr, void *mem_buffer, int long_count);
154 To write a string of bytes (8 bit) to one specific I/O address:
156 void writesb(void __iomem *addr, const void *mem_buffer, int byte_count);
159 To write a string of words (16 bit) to one specific I/O address:
161 void writesw(void __iomem *addr, const void *mem_buffer, int word_count);
164 To write a string of long words (32 bit) to one specific I/O address:
166 void writesl(void __iomem *addr, const void *mem_buffer, int long_count);
169 @section special_access Special IN/OUT access