Lee Leahy | c1e4f89 | 2016-01-07 11:24:24 -0800 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Board</title> |
| 5 | </head> |
| 6 | <body> |
| 7 | |
| 8 | <h1>x86 Board Development</h1> |
| 9 | <p> |
| 10 | Board development requires System-on-a-Chip (SoC) support. |
| 11 | The combined steps are listed |
Lee Leahy | e8424cf | 2016-02-03 07:28:22 -0800 | [diff] [blame] | 12 | <a target="_blank" href="../development.html">here</a>. |
Lee Leahy | c1e4f89 | 2016-01-07 11:24:24 -0800 | [diff] [blame] | 13 | The development steps for the board are listed below: |
| 14 | </p> |
| 15 | <ol> |
| 16 | <li><a href="#RequiredFiles">Required Files</a></li> |
Lee Leahy | 66decf1 | 2016-02-04 11:21:33 -0800 | [diff] [blame] | 17 | <li>Enable <a href="#SerialOutput">Serial Output</a></li> |
Lee Leahy | fcf776f | 2016-02-04 11:23:36 -0800 | [diff] [blame] | 18 | <li>Load the <a href="#SpdData">Memory Timing Data</a></li> |
Lee Leahy | de8c7e3 | 2016-02-14 14:55:29 -0800 | [diff] [blame] | 19 | <li><a href="#DisablePciDevices">Disable</a> the PCI devices</li> |
Lee Leahy | bf08da2 | 2016-02-20 17:48:35 -0800 | [diff] [blame] | 20 | <li><a href="#AcpiTables">ACPI Tables</a></li> |
Lee Leahy | c1e4f89 | 2016-01-07 11:24:24 -0800 | [diff] [blame] | 21 | </ol> |
| 22 | |
| 23 | |
| 24 | <hr> |
| 25 | <h1><a name="RequiredFiles">Required Files</a></h1> |
| 26 | <p> |
| 27 | Create the board directory as src/mainboard/<Vendor>/<Board>. |
| 28 | </p> |
| 29 | |
| 30 | <p> |
| 31 | The following files are required to build a new board: |
| 32 | </p> |
| 33 | <ol> |
| 34 | <li>Kconfig.name - Defines the Kconfig value for the board</li> |
| 35 | <li>Kconfig |
| 36 | <ol type="A"> |
| 37 | <li>Selects the SoC for the board and specifies the SPI flash size |
| 38 | <ol type="I"> |
| 39 | <li>BOARD_ROMSIZE_KB_<Size></li> |
| 40 | <li>SOC_<Vendor>_<Chip Family></li> |
| 41 | </ol> |
| 42 | </li> |
| 43 | <li>Declare the Kconfig values for: |
| 44 | <ol type="I"> |
| 45 | <li>MAINBOARD_DIR</li> |
| 46 | <li>MAINBOARD_PART_NUMBER</li> |
| 47 | <li>MAINBOARD_VENDOR</li> |
| 48 | </ol> |
| 49 | </li> |
| 50 | </ol> |
| 51 | </li> |
| 52 | <li>devicetree.cb - Enable root bridge and serial port |
| 53 | <ol type="A"> |
| 54 | <li>The first line must be "chip soc/Intel/<soc family>"; |
| 55 | this path is used by the generated static.c to include the chip.h |
| 56 | header file |
| 57 | </li> |
| 58 | </ol> |
| 59 | </li> |
| 60 | <li>romstage.c |
| 61 | <ol type="A"> |
| 62 | <li>Add routine mainboard_romstage_entry which calls romstage_common</li> |
| 63 | </ol> |
| 64 | </li> |
| 65 | <li>Configure coreboot build: |
| 66 | <ol type="A"> |
| 67 | <li>Set LOCALVERSION</li> |
Lee Leahy | c1e4f89 | 2016-01-07 11:24:24 -0800 | [diff] [blame] | 68 | <li>Select vendor for the board</li> |
| 69 | <li>Select the board</li> |
| 70 | <li>CBFS_SIZE = 0x00100000</li> |
| 71 | <li>Set the CPU_MICROCODE_CBFS_LEN</li> |
| 72 | <li>Set the CPU_MICROCODE_CBFS_LOC</li> |
| 73 | <li>Set the FSP_IMAGE_ID_STRING</li> |
| 74 | <li>Set the FSP_LOC</li> |
| 75 | <li>Disable GOP_SUPPORT</li> |
| 76 | <li>No payload</li> |
| 77 | <li>Choose the default value for all other options</li> |
| 78 | </ol> |
| 79 | </li> |
| 80 | </ol> |
| 81 | |
| 82 | |
| 83 | <hr> |
Lee Leahy | 66decf1 | 2016-02-04 11:21:33 -0800 | [diff] [blame] | 84 | <h1><a name="SerialOutput">Enable Serial Output</a></h1> |
| 85 | <p> |
| 86 | Use the following steps to enable serial output: |
| 87 | </p> |
| 88 | <ol> |
| 89 | <li>Implement the car_mainboard_pre_console_init routine in the com_init.c |
| 90 | file: |
| 91 | <ol type="A"> |
| 92 | <li>Power on and enable the UART controller</li> |
| 93 | <li>Connect the UART receive and transmit data lines to the |
| 94 | appropriate SoC pins |
| 95 | </li> |
| 96 | </ol> |
| 97 | </li> |
| 98 | <li>Add Makefile.inc |
| 99 | <ol type="A"> |
| 100 | <li>Add com_init.c to romstage</li> |
| 101 | </ol> |
| 102 | </li> |
| 103 | </ol> |
| 104 | |
| 105 | |
Lee Leahy | fcf776f | 2016-02-04 11:23:36 -0800 | [diff] [blame] | 106 | <hr> |
| 107 | <h1><a name="SpdData">Memory Timing Data</a></h1> |
| 108 | <p> |
| 109 | Memory timing data is located in the flash. This data is in the format of |
| 110 | <a target="_blank" href="https://en.wikipedia.org/wiki/Serial_presence_detect">serial presence detect</a> |
| 111 | (SPD) data. |
| 112 | Use the following steps to load the SPD data: |
| 113 | </p> |
| 114 | <ol> |
| 115 | <li>Edit Kconfig to add the DISPLAY_SPD_DATA" value which enables the |
| 116 | display of the SPD data being passed to MemoryInit |
| 117 | </li> |
| 118 | <li>Create an "spd" subdirectory</li> |
| 119 | <li>Create an spd/spd.c file for the SPD implementation |
| 120 | <ol type="A"> |
| 121 | <li>Implement the mainboard_fill_spd_data routine |
| 122 | <ol type="i"> |
| 123 | <li>Read the SPD data either from the spd.bin file or using I2C or SMBUS</li> |
| 124 | <li>Fill in the pei_data structure with SPD data for each of the DIMMs</li> |
| 125 | <li>Set the DIMM channel configuration</li> |
| 126 | </ol> |
| 127 | </li> |
| 128 | </ol> |
| 129 | </li> |
| 130 | <li>Add an .spd.hex file containing the memory timing data to the spd subdirectory</li> |
| 131 | <li>Create spd/Makefile.inc |
| 132 | <ol type="A"> |
| 133 | <li>Add spd.c to romstage</li> |
| 134 | <li>Add the .spd.hex file to SPD_SOURCES</li> |
| 135 | </ol> |
| 136 | </li> |
| 137 | <li>Edit Makefile.inc to add the spd subdirectory</li> |
| 138 | <li>Edit romstage.c |
| 139 | <ol type="A"> |
| 140 | <li>Call mainboard_fill_spd_data</li> |
| 141 | <li>Add mainboard_memory_init_params to copy the SPD and DRAM |
| 142 | configuration data from the pei_data structure into the UPDs |
| 143 | for MemoryInit |
| 144 | </li> |
| 145 | </ol> |
| 146 | </li> |
| 147 | <li>Edit devicetree.cb |
| 148 | <ol type="A"> |
| 149 | <li>Include the UPD parameters for MemoryInit except for: |
| 150 | <ul> |
| 151 | <li>Address of SPD data</li> |
| 152 | <li>DRAM configuration set above</li> |
| 153 | </ul> |
| 154 | </li> |
| 155 | </ol> |
| 156 | </li> |
| 157 | <li>A working FSP |
| 158 | <a target="_blank" href="../fsp1_1.html#MemoryInit">MemoryInit</a> |
| 159 | routine is required to complete debugging</li> |
| 160 | <li>Debug the result until port 0x80 outputs |
| 161 | <ol type="A"> |
| 162 | <li>0x34: |
| 163 | - Just after entering |
| 164 | <a target="_blank" href="http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/drivers/intel/fsp1_1/raminit.c;hb=HEAD#l67">raminit</a> |
| 165 | </li> |
| 166 | <li>0x36: |
| 167 | - Just before displaying the |
| 168 | <a target="_blank" href="http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/drivers/intel/fsp1_1/raminit.c;hb=HEAD#l106">UPD parameters</a> |
| 169 | for FSP MemoryInit |
| 170 | </li> |
| 171 | <li>0x92: <a target="_blank" href="http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/include/console/post_codes.h;hb=HEAD#l219">POST_FSP_MEMORY_INIT</a> |
| 172 | - Just before calling FSP |
| 173 | <a target="_blank" href="http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/drivers/intel/fsp1_1/raminit.c;hb=HEAD#l125">MemoryInit</a> |
| 174 | </li> |
| 175 | <li>0x37: |
| 176 | - Just after returning from FSP |
| 177 | <a target="_blank" href="http://review.coreboot.org/gitweb?p=coreboot.git;a=blob;f=src/drivers/intel/fsp1_1/raminit.c;hb=HEAD#l127">MemoryInit</a> |
| 178 | </li> |
| 179 | </ol> |
| 180 | </li> |
| 181 | <li>Continue debugging with CONFIG_DISPLAY_HOBS enabled until TempRamExit is called</li> |
| 182 | </ol> |
| 183 | |
Lee Leahy | 66decf1 | 2016-02-04 11:21:33 -0800 | [diff] [blame] | 184 | |
Lee Leahy | de8c7e3 | 2016-02-14 14:55:29 -0800 | [diff] [blame] | 185 | |
Lee Leahy | 66decf1 | 2016-02-04 11:21:33 -0800 | [diff] [blame] | 186 | <hr> |
Lee Leahy | de8c7e3 | 2016-02-14 14:55:29 -0800 | [diff] [blame] | 187 | <h1><a name="DisablePciDevices">Disable PCI Devices</a></h1> |
| 188 | <p> |
| 189 | Ramstage's BS_DEV_ENUMERATE state displays the PCI vendor and device IDs for all |
| 190 | of the devices in the system. Edit the devicetree.cb file: |
| 191 | </p> |
| 192 | <ol> |
| 193 | <li>Edit the devicetree.cb file: |
| 194 | <ol type="A"> |
| 195 | <li>Add an entry for a PCI device.function and turn it off. The entry |
| 196 | should look similar to: |
| 197 | <pre><code>device pci 14.0 off end</code></pre> |
| 198 | </li> |
| 199 | <li>Turn on the devices for: |
| 200 | <ul> |
| 201 | <li>Memory Controller</li> |
| 202 | <li>Debug serial device</li> |
| 203 | </ul> |
| 204 | </li> |
| 205 | </ol> |
| 206 | </li> |
| 207 | <li>Debug until the BS_DEV_ENUMERATE state shows the proper state for all of the devices</li> |
| 208 | </ol> |
| 209 | |
| 210 | |
Lee Leahy | bf08da2 | 2016-02-20 17:48:35 -0800 | [diff] [blame] | 211 | |
Lee Leahy | de8c7e3 | 2016-02-14 14:55:29 -0800 | [diff] [blame] | 212 | <hr> |
Lee Leahy | bf08da2 | 2016-02-20 17:48:35 -0800 | [diff] [blame] | 213 | <h1><a name="AcpiTables">ACPI Tables</a></h1> |
| 214 | <ol> |
| 215 | <li>Edit Kconfig |
| 216 | <ol type="A"> |
| 217 | <li>Add "select HAVE_ACPI_TABLES"</li> |
| 218 | </ol> |
| 219 | </li> |
| 220 | <li>Add the acpi_tables.c module: |
| 221 | <ol type="A"> |
| 222 | <li>Include soc/acpi.h</li> |
| 223 | <li>Add the acpi_create_fadt routine |
| 224 | <ol type="I"> |
| 225 | <li>fill in the ACPI header</li> |
| 226 | <li>Call the acpi_fill_in_fadt routine</li> |
| 227 | </ol> |
| 228 | </li> |
| 229 | </ol> |
| 230 | </li> |
| 231 | <li>Add the dsdt.asl module: |
| 232 | </li> |
| 233 | </ol> |
| 234 | |
| 235 | |
| 236 | |
| 237 | <hr> |
| 238 | <p>Modified: 20 February 2016</p> |
Lee Leahy | c1e4f89 | 2016-01-07 11:24:24 -0800 | [diff] [blame] | 239 | </body> |
Aaron Durbin | bf1e481 | 2016-05-10 15:12:08 -0500 | [diff] [blame] | 240 | </html> |