€•­ŽŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/arch/sh/new-machine”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒA/var/lib/git/docbuild/linux/Documentation/arch/sh/new-machine.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAdding a new board to LinuxSH”h]”hŒAdding a new board to LinuxSH”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ block_quote”“”)”}”(hŒ!Paul Mundt ”h]”hŒ paragraph”“”)”}”(hŒ Paul Mundt ”h]”(hŒ Paul Mundt <”…””}”(hhåh²hh³Nh´NubhŒ reference”“”)”}”(hŒlethal@linux-sh.org”h]”hŒlethal@linux-sh.org”…””}”(hhïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:lethal@linux-sh.org”uh1híhhåubhŒ>”…””}”(hhåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhä)”}”(hŒøThis document attempts to outline what steps are necessary to add support for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This also attempts to outline some of the noticeable changes between the 2.4 and the 2.5/2.6 SH backend.”h]”hŒøThis document attempts to outline what steps are necessary to add support for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This also attempts to outline some of the noticeable changes between the 2.4 and the 2.5/2.6 SH backend.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1. New Directory Structure”h]”hŒ1. New Directory Structure”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´Kubhä)”}”(hXŒThe first thing to note is the new directory structure. Under 2.4, most of the board-specific code (with the exception of stboards) ended up in arch/sh/kernel/ directly, with board-specific headers ending up in include/asm-sh/. For the new kernel, things are broken out by board type, companion chip type, and CPU type. Looking at a tree view of this directory hierarchy looks like the following:”h]”hXŒThe first thing to note is the new directory structure. Under 2.4, most of the board-specific code (with the exception of stboards) ended up in arch/sh/kernel/ directly, with board-specific headers ending up in include/asm-sh/. For the new kernel, things are broken out by board type, companion chip type, and CPU type. Looking at a tree view of this directory hierarchy looks like the following:”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjh²hubhä)”}”(hŒBoard-specific code::”h]”hŒBoard-specific code:”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjh²hubhŒ literal_block”“”)”}”(hX. |-- arch | `-- sh | `-- boards | |-- adx | | `-- board-specific files | |-- bigsur | | `-- board-specific files | | | ... more boards here ... | `-- include `-- asm-sh |-- adx | `-- board-specific headers |-- bigsur | `-- board-specific headers | .. more boards here ...”h]”hX. |-- arch | `-- sh | `-- boards | |-- adx | | `-- board-specific files | |-- bigsur | | `-- board-specific files | | | ... more boards here ... | `-- include `-- asm-sh |-- adx | `-- board-specific headers |-- bigsur | `-- board-specific headers | .. more boards here ...”…””}”hjLsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´Khjh²hubhä)”}”(hŒNext, for companion chips::”h]”hŒNext, for companion chips:”…””}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K.hjh²hubjK)”}”(hŒ‰. `-- arch `-- sh `-- cchips `-- hd6446x `-- hd64461 `-- cchip-specific files”h]”hŒ‰. `-- arch `-- sh `-- cchips `-- hd6446x `-- hd64461 `-- cchip-specific files”…””}”hjhsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´K0hjh²hubhä)”}”(hŒ¯... and so on. Headers for the companion chips are treated the same way as board-specific headers. Thus, include/asm-sh/hd64461 is home to all of the hd64461-specific headers.”h]”hŒ¯... and so on. Headers for the companion chips are treated the same way as board-specific headers. Thus, include/asm-sh/hd64461 is home to all of the hd64461-specific headers.”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K8hjh²hubhä)”}”(hŒ0Finally, CPU family support is also abstracted::”h]”hŒ/Finally, CPU family support is also abstracted:”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khjh²hubhä)”}”(hŒƒIt should be noted that CPU subtypes are _not_ abstracted. Thus, these still need to be dealt with by the CPU family specific code.”h]”hŒƒIt should be noted that CPU subtypes are _not_ abstracted. Thus, these still need to be dealt with by the CPU family specific code.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KVhjh²hubeh}”(h]”Œnew-directory-structure”ah ]”h"]”Œ1. new directory structure”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2. Adding a New Board”h]”hŒ2. Adding a New Board”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¶h²hh³hÇh´KZubhä)”}”(hŒÎThe first thing to determine is whether the board you are adding will be isolated, or whether it will be part of a family of boards that can mostly share the same board-specific code with minor differences.”h]”hŒÎThe first thing to determine is whether the board you are adding will be isolated, or whether it will be part of a family of boards that can mostly share the same board-specific code with minor differences.”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K\hj¶h²hubhä)”}”(hX·In the first case, this is just a matter of making a directory for your board in arch/sh/boards/ and adding rules to hook your board in with the build system (more on this in the next section). However, for board families it makes more sense to have a common top-level arch/sh/boards/ directory and then populate that with sub-directories for each member of the family. Both the Solution Engine and the hp6xx boards are an example of this.”h]”hX·In the first case, this is just a matter of making a directory for your board in arch/sh/boards/ and adding rules to hook your board in with the build system (more on this in the next section). However, for board families it makes more sense to have a common top-level arch/sh/boards/ directory and then populate that with sub-directories for each member of the family. Both the Solution Engine and the hp6xx boards are an example of this.”…””}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K`hj¶h²hubhä)”}”(hXAfter you have setup your new arch/sh/boards/ directory, remember that you should also add a directory in include/asm-sh for headers localized to this board (if there are going to be more than one). In order to interoperate seamlessly with the build system, it's best to have this directory the same as the arch/sh/boards/ directory name, though if your board is again part of a family, the build system has ways of dealing with this (via incdir-y overloading), and you can feel free to name the directory after the family member itself.”h]”hXAfter you have setup your new arch/sh/boards/ directory, remember that you should also add a directory in include/asm-sh for headers localized to this board (if there are going to be more than one). In order to interoperate seamlessly with the build system, it’s best to have this directory the same as the arch/sh/boards/ directory name, though if your board is again part of a family, the build system has ways of dealing with this (via incdir-y overloading), and you can feel free to name the directory after the family member itself.”…””}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kghj¶h²hubhä)”}”(hX|There are a few things that each board is required to have, both in the arch/sh/boards and the include/asm-sh/ hierarchy. In order to better explain this, we use some examples for adding an imaginary board. For setup code, we're required at the very least to provide definitions for get_system_type() and platform_setup(). For our imaginary board, this might look something like::”h]”hX}There are a few things that each board is required to have, both in the arch/sh/boards and the include/asm-sh/ hierarchy. In order to better explain this, we use some examples for adding an imaginary board. For setup code, we’re required at the very least to provide definitions for get_system_type() and platform_setup(). For our imaginary board, this might look something like:”…””}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kphj¶h²hubjK)”}”(hX/* * arch/sh/boards/vapor/setup.c - Setup code for imaginary board */ #include const char *get_system_type(void) { return "FooTech Vaporboard"; } int __init platform_setup(void) { /* * If our hardware actually existed, we would do real * setup here. Though it's also sane to leave this empty * if there's no real init work that has to be done for * this board. */ /* Start-up imaginary PCI ... */ /* And whatever else ... */ return 0; }”h]”hX/* * arch/sh/boards/vapor/setup.c - Setup code for imaginary board */ #include const char *get_system_type(void) { return "FooTech Vaporboard"; } int __init platform_setup(void) { /* * If our hardware actually existed, we would do real * setup here. Though it's also sane to leave this empty * if there's no real init work that has to be done for * this board. */ /* Start-up imaginary PCI ... */ /* And whatever else ... */ return 0; }”…””}”hjÿsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´Kwhj¶h²hubhä)”}”(hŒ`Our new imaginary board will also have to tie into the machvec in order for it to be of any use.”h]”hŒ`Our new imaginary board will also have to tie into the machvec in order for it to be of any use.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K‘hj¶h²hubhä)”}”(hŒ3machvec functions fall into a number of categories:”h]”hŒ3machvec functions fall into a number of categories:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K”hj¶h²hubhÞ)”}”(hXV- I/O functions to IO memory (inb etc) and PCI/main memory (readb etc). - I/O mapping functions (ioport_map, ioport_unmap, etc). - a 'heartbeat' function. - PCI and IRQ initialization routines. - Consistent allocators (for boards that need special allocators, particularly for allocating out of some board-specific SRAM for DMA handles). ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒEI/O functions to IO memory (inb etc) and PCI/main memory (readb etc).”h]”hä)”}”(hj6h]”hŒEI/O functions to IO memory (inb etc) and PCI/main memory (readb etc).”…””}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K–hj4ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubj3)”}”(hŒ6I/O mapping functions (ioport_map, ioport_unmap, etc).”h]”hä)”}”(hjMh]”hŒ6I/O mapping functions (ioport_map, ioport_unmap, etc).”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K—hjKubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubj3)”}”(hŒa 'heartbeat' function.”h]”hä)”}”(hjdh]”hŒa ‘heartbeat’ function.”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K˜hjbubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubj3)”}”(hŒ$PCI and IRQ initialization routines.”h]”hä)”}”(hj{h]”hŒ$PCI and IRQ initialization routines.”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K™hjyubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubj3)”}”(hŒŽConsistent allocators (for boards that need special allocators, particularly for allocating out of some board-specific SRAM for DMA handles). ”h]”hä)”}”(hŒConsistent allocators (for boards that need special allocators, particularly for allocating out of some board-specific SRAM for DMA handles).”h]”hŒConsistent allocators (for boards that need special allocators, particularly for allocating out of some board-specific SRAM for DMA handles).”…””}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kšhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hj/ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j-h³hÇh´K–hj)ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K–hj¶h²hubhä)”}”(hŒ”There are machvec functions added and removed over time, so always be sure to consult include/asm-sh/machvec.h for the current state of the machvec.”h]”hŒ”There are machvec functions added and removed over time, so always be sure to consult include/asm-sh/machvec.h for the current state of the machvec.”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kžhj¶h²hubhä)”}”(hXPThe kernel will automatically wrap in generic routines for undefined function pointers in the machvec at boot time, as machvec functions are referenced unconditionally throughout most of the tree. Some boards have incredibly sparse machvecs (such as the dreamcast and sh03), whereas others must define virtually everything (rts7751r2d).”h]”hXPThe kernel will automatically wrap in generic routines for undefined function pointers in the machvec at boot time, as machvec functions are referenced unconditionally throughout most of the tree. Some boards have incredibly sparse machvecs (such as the dreamcast and sh03), whereas others must define virtually everything (rts7751r2d).”…””}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K¡hj¶h²hubhä)”}”(hŒGAdding a new machine is relatively trivial (using vapor as an example):”h]”hŒGAdding a new machine is relatively trivial (using vapor as an example):”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K§hj¶h²hubhä)”}”(hŒ¥If the board-specific definitions are quite minimalistic, as is the case for the vast majority of boards, simply having a single board-specific header is sufficient.”h]”hŒ¥If the board-specific definitions are quite minimalistic, as is the case for the vast majority of boards, simply having a single board-specific header is sufficient.”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K©hj¶h²hubhÞ)”}”(hXÐ- add a new file include/asm-sh/vapor.h which contains prototypes for any machine specific IO functions prefixed with the machine name, for example vapor_inb. These will be needed when filling out the machine vector. Note that these prototypes are generated automatically by setting __IO_PREFIX to something sensible. A typical example would be:: #define __IO_PREFIX vapor #include somewhere in the board-specific header. Any boards being ported that still have a legacy io.h should remove it entirely and switch to the new model. - Add machine vector definitions to the board's setup.c. At a bare minimum, this must be defined as something like:: struct sh_machine_vector mv_vapor __initmv = { .mv_name = "vapor", }; ALIAS_MV(vapor) - finally add a file arch/sh/boards/vapor/io.c, which contains definitions of the machine specific io functions (if there are enough to warrant it). ”h]”j.)”}”(hhh]”(j3)”}”(hX1add a new file include/asm-sh/vapor.h which contains prototypes for any machine specific IO functions prefixed with the machine name, for example vapor_inb. These will be needed when filling out the machine vector. Note that these prototypes are generated automatically by setting __IO_PREFIX to something sensible. A typical example would be:: #define __IO_PREFIX vapor #include somewhere in the board-specific header. Any boards being ported that still have a legacy io.h should remove it entirely and switch to the new model. ”h]”(hä)”}”(hŒÖadd a new file include/asm-sh/vapor.h which contains prototypes for any machine specific IO functions prefixed with the machine name, for example vapor_inb. These will be needed when filling out the machine vector.”h]”hŒÖadd a new file include/asm-sh/vapor.h which contains prototypes for any machine specific IO functions prefixed with the machine name, for example vapor_inb. These will be needed when filling out the machine vector.”…””}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K­hjõubhä)”}”(hŒNote that these prototypes are generated automatically by setting __IO_PREFIX to something sensible. A typical example would be::”h]”hŒ€Note that these prototypes are generated automatically by setting __IO_PREFIX to something sensible. A typical example would be:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K²hjõubjK)”}”(hŒ5#define __IO_PREFIX vapor #include ”h]”hŒ5#define __IO_PREFIX vapor #include ”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´Kµhjõubhä)”}”(hŒ”somewhere in the board-specific header. Any boards being ported that still have a legacy io.h should remove it entirely and switch to the new model.”h]”hŒ”somewhere in the board-specific header. Any boards being ported that still have a legacy io.h should remove it entirely and switch to the new model.”…””}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K¸hjõubeh}”(h]”h ]”h"]”h$]”h&]”uh1j2hjòubj3)”}”(hŒæAdd machine vector definitions to the board's setup.c. At a bare minimum, this must be defined as something like:: struct sh_machine_vector mv_vapor __initmv = { .mv_name = "vapor", }; ALIAS_MV(vapor) ”h]”(hä)”}”(hŒrAdd machine vector definitions to the board's setup.c. At a bare minimum, this must be defined as something like::”h]”hŒsAdd machine vector definitions to the board’s setup.c. At a bare minimum, this must be defined as something like:”…””}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K»hj7ubjK)”}”(hŒ]struct sh_machine_vector mv_vapor __initmv = { .mv_name = "vapor", }; ALIAS_MV(vapor)”h]”hŒ]struct sh_machine_vector mv_vapor __initmv = { .mv_name = "vapor", }; ALIAS_MV(vapor)”…””}”hjIsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´K¾hj7ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j2hjòubj3)”}”(hŒ“finally add a file arch/sh/boards/vapor/io.c, which contains definitions of the machine specific io functions (if there are enough to warrant it). ”h]”hä)”}”(hŒ’finally add a file arch/sh/boards/vapor/io.c, which contains definitions of the machine specific io functions (if there are enough to warrant it).”h]”hŒ’finally add a file arch/sh/boards/vapor/io.c, which contains definitions of the machine specific io functions (if there are enough to warrant it).”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÃhj]ubah}”(h]”h ]”h"]”h$]”h&]”uh1j2hjòubeh}”(h]”h ]”h"]”h$]”h&]”j®j¯uh1j-h³hÇh´K­hjîubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K­hj¶h²hubeh}”(h]”Œadding-a-new-board”ah ]”h"]”Œ2. adding a new board”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KZubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 3. Hooking into the Build System”h]”hŒ 3. Hooking into the Build System”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj‰h²hh³hÇh´KÇubhä)”}”(hŒ²Now that we have the corresponding directories setup, and all of the board-specific code is in place, it's time to look at how to get the whole mess to fit into the build system.”h]”hŒ´Now that we have the corresponding directories setup, and all of the board-specific code is in place, it’s time to look at how to get the whole mess to fit into the build system.”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÉhj‰h²hubhä)”}”(hŒŒLarge portions of the build system are now entirely dynamic, and merely require the proper entry here and there in order to get things done.”h]”hŒŒLarge portions of the build system are now entirely dynamic, and merely require the proper entry here and there in order to get things done.”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÍhj‰h²hubhä)”}”(hŒ[The first thing to do is to add an entry to arch/sh/Kconfig, under the "System type" menu::”h]”hŒ^The first thing to do is to add an entry to arch/sh/Kconfig, under the “System type†menu:”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÐhj‰h²hubjK)”}”(hŒoconfig SH_VAPOR bool "Vapor" help select Vapor if configuring for a FooTech Vaporboard.”h]”hŒoconfig SH_VAPOR bool "Vapor" help select Vapor if configuring for a FooTech Vaporboard.”…””}”hjÄsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´KÓhj‰h²hubhä)”}”(hXdnext, this has to be added into arch/sh/Makefile. All boards require a machdir-y entry in order to be built. This entry needs to be the name of the board directory as it appears in arch/sh/boards, even if it is in a sub-directory (in which case, all parent directories below arch/sh/boards/ need to be listed). For our new board, this entry can look like::”h]”hXcnext, this has to be added into arch/sh/Makefile. All boards require a machdir-y entry in order to be built. This entry needs to be the name of the board directory as it appears in arch/sh/boards, even if it is in a sub-directory (in which case, all parent directories below arch/sh/boards/ need to be listed). For our new board, this entry can look like:”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KØhj‰h²hubjK)”}”(hŒ$machdir-$(CONFIG_SH_VAPOR) += vapor”h]”hŒ$machdir-$(CONFIG_SH_VAPOR) += vapor”…””}”hjàsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´KÞhj‰h²hubhä)”}”(hŒMprovided that we've placed everything in the arch/sh/boards/vapor/ directory.”h]”hŒOprovided that we’ve placed everything in the arch/sh/boards/vapor/ directory.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kàhj‰h²hubhä)”}”(hXeNext, the build system assumes that your include/asm-sh directory will also be named the same. If this is not the case (as is the case with multiple boards belonging to a common family), then the directory name needs to be implicitly appended to incdir-y. The existing code manages this for the Solution Engine and hp6xx boards, so see these for an example.”h]”hXeNext, the build system assumes that your include/asm-sh directory will also be named the same. If this is not the case (as is the case with multiple boards belonging to a common family), then the directory name needs to be implicitly appended to incdir-y. The existing code manages this for the Solution Engine and hp6xx boards, so see these for an example.”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kâhj‰h²hubhä)”}”(hXƒOnce that is taken care of, it's time to add an entry for the mach type. This is done by adding an entry to the end of the arch/sh/tools/mach-types list. The method for doing this is self explanatory, and so we won't waste space restating it here. After this is done, you will be able to use implicit checks for your board if you need this somewhere throughout the common code, such as::”h]”hX†Once that is taken care of, it’s time to add an entry for the mach type. This is done by adding an entry to the end of the arch/sh/tools/mach-types list. The method for doing this is self explanatory, and so we won’t waste space restating it here. After this is done, you will be able to use implicit checks for your board if you need this somewhere throughout the common code, such as:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kèhj‰h²hubjK)”}”(hŒ]/* Make sure we're on the FooTech Vaporboard */ if (!mach_is_vapor()) return -ENODEV;”h]”hŒ]/* Make sure we're on the FooTech Vaporboard */ if (!mach_is_vapor()) return -ENODEV;”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´Kïhj‰h²hubhä)”}”(hXalso note that the mach_is_boardname() check will be implicitly forced to lowercase, regardless of the fact that the mach-types entries are all uppercase. You can read the script if you really care, but it's pretty ugly, so you probably don't want to do that.”h]”hXalso note that the mach_is_boardname() check will be implicitly forced to lowercase, regardless of the fact that the mach-types entries are all uppercase. You can read the script if you really care, but it’s pretty ugly, so you probably don’t want to do that.”…””}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kóhj‰h²hubhä)”}”(hŒéNow all that's left to do is providing a defconfig for your new board. This way, other people who end up with this board can simply use this config for reference instead of trying to guess what settings are supposed to be used on it.”h]”hŒëNow all that’s left to do is providing a defconfig for your new board. This way, other people who end up with this board can simply use this config for reference instead of trying to guess what settings are supposed to be used on it.”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Køhj‰h²hubhä)”}”(hŒàAlso, as soon as you have copied over a sample .config for your new board (assume arch/sh/configs/vapor_defconfig), you can also use this directly as a build target, and it will be implicitly listed as such in the help text.”h]”hŒàAlso, as soon as you have copied over a sample .config for your new board (assume arch/sh/configs/vapor_defconfig), you can also use this directly as a build target, and it will be implicitly listed as such in the help text.”…””}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kýhj‰h²hubhä)”}”(hŒELooking at the 'make help' output, you should now see something like:”h]”hŒILooking at the ‘make help’ output, you should now see something like:”…””}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj‰h²hubhä)”}”(hŒ#Architecture specific targets (sh):”h]”hŒ#Architecture specific targets (sh):”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj‰h²hubhÞ)”}”(hX‡======================= ============================================= zImage Compressed kernel image (arch/sh/boot/zImage) adx_defconfig Build for adx cqreek_defconfig Build for cqreek dreamcast_defconfig Build for dreamcast ... vapor_defconfig Build for vapor ======================= ============================================= ”h]”hŒtable”“”)”}”(hhh]”hŒtgroup”“”)”}”(hhh]”(hŒcolspec”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jzhjwubj{)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K-uh1jzhjwubhŒtbody”“”)”}”(hhh]”(hŒrow”“”)”}”(hhh]”(hŒentry”“”)”}”(hhh]”hä)”}”(hŒzImage”h]”hŒzImage”…””}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhjœubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhj—ubj›)”}”(hhh]”hä)”}”(hŒ-Compressed kernel image (arch/sh/boot/zImage)”h]”hŒ-Compressed kernel image (arch/sh/boot/zImage)”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhj—ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubj–)”}”(hhh]”(j›)”}”(hhh]”hä)”}”(hŒ adx_defconfig”h]”hŒ adx_defconfig”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´MhjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjÐubj›)”}”(hhh]”hä)”}”(hŒ Build for adx”h]”hŒ Build for adx”…””}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjÐubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubj–)”}”(hhh]”(j›)”}”(hhh]”hä)”}”(hŒcqreek_defconfig”h]”hŒcqreek_defconfig”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjubj›)”}”(hhh]”hä)”}”(hŒBuild for cqreek”h]”hŒBuild for cqreek”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubj–)”}”(hhh]”(j›)”}”(hhh]”hä)”}”(hŒdreamcast_defconfig”h]”hŒdreamcast_defconfig”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hjAubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhj>ubj›)”}”(hhh]”hä)”}”(hŒBuild for dreamcast”h]”hŒBuild for dreamcast”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hjXubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhj>ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubj–)”}”(hhh]”(j›)”}”(hhh]”hä)”}”(hŒ...”h]”hŒ...”…””}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hjxubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjuubj›)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jšhjuubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubj–)”}”(hhh]”(j›)”}”(hhh]”hä)”}”(hŒvapor_defconfig”h]”hŒvapor_defconfig”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hj¡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjžubj›)”}”(hhh]”hä)”}”(hŒBuild for vapor”h]”hŒBuild for vapor”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hj¸ubah}”(h]”h ]”h"]”h$]”h&]”uh1jšhjžubeh}”(h]”h ]”h"]”h$]”h&]”uh1j•hj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjwubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1juhjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jphjlubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‰h²hubhä)”}”(hŒwhich then allows you to do::”h]”hŒwhich then allows you to do:”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj‰h²hubjK)”}”(hŒ?$ make ARCH=sh CROSS_COMPILE=sh4-linux- vapor_defconfig vmlinux”h]”hŒ?$ make ARCH=sh CROSS_COMPILE=sh4-linux- vapor_defconfig vmlinux”…””}”hjüsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jJh³hÇh´Mhj‰h²hubhä)”}”(hŒÚwhich will in turn copy the defconfig for this board, run it through oldconfig (prompting you for any new options since the time of creation), and start you on your way to having a functional kernel for your new board.”h]”hŒÚwhich will in turn copy the defconfig for this board, run it through oldconfig (prompting you for any new options since the time of creation), and start you on your way to having a functional kernel for your new board.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj‰h²hubeh}”(h]”Œhooking-into-the-build-system”ah ]”h"]”Œ 3. hooking into the build system”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÇubeh}”(h]”Œadding-a-new-board-to-linuxsh”ah ]”h"]”Œadding a new board to linuxsh”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”jšŒfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jJŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j%j"j³j°j†jƒjjuŒ nametypes”}”(j%‰j³‰j†‰j‰uh}”(j"hÊj°jjƒj¶jj‰uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”hŒsystem_message”“”)”}”(hhh]”hä)”}”(hŒeUnexpected possible title overline or transition. Treating it as ordinary text because it's so short.”h]”hŒgUnexpected possible title overline or transition. Treating it as ordinary text because it’s so short.”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãhj®ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”M Œsource”hÇuh1j¬hjxubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.