1*4882a593Smuzhiyun# 2*4882a593Smuzhiyun# Copyright (C) 2013, Miao Yan <miao.yan@windriver.com> 3*4882a593Smuzhiyun# Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0+ 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunVxWorks Support 9*4882a593Smuzhiyun=============== 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunThis document describes the information about U-Boot loading VxWorks kernel. 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunStatus 14*4882a593Smuzhiyun------ 15*4882a593SmuzhiyunU-Boot supports loading VxWorks kernels via 'bootvx' and 'bootm' commands. 16*4882a593SmuzhiyunFor booting old kernels (6.9.x) on PowerPC and ARM, and all kernel versions 17*4882a593Smuzhiyunon other architectures, 'bootvx' shall be used. For booting VxWorks 7 kernels 18*4882a593Smuzhiyunon PowerPC and ARM, 'bootm' shall be used. 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun64-bit x86 kernel cannot be loaded as of today. 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunVxWork 7 on PowerPC and ARM 23*4882a593Smuzhiyun--------------------------- 24*4882a593SmuzhiyunFrom VxWorks 7, VxWorks starts adopting device tree as its hardware decription 25*4882a593Smuzhiyunmechansim (for PowerPC and ARM), thus requiring boot interface changes. 26*4882a593SmuzhiyunThis section will describe the new interface. 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunFor PowerPC, the calling convention of the new VxWorks entry point conforms to 29*4882a593Smuzhiyunthe ePAPR standard, which is shown below (see ePAPR for more details): 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun void (*kernel_entry)(fdt_addr, 0, 0, EPAPR_MAGIC, boot_IMA, 0, 0) 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunFor ARM, the calling convention is show below: 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun void (*kernel_entry)(void *fdt_addr) 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunWhen booting new VxWorks kernel (uImage format), the parameters passed to bootm 38*4882a593Smuzhiyunis like below: 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun bootm <kernel image address> - <device tree address> 41*4882a593Smuzhiyun 42*4882a593SmuzhiyunVxWorks bootline 43*4882a593Smuzhiyun---------------- 44*4882a593SmuzhiyunWhen using 'bootvx', the kernel bootline must be prepared by U-Boot at a 45*4882a593Smuzhiyunboard-specific address before loading VxWorks. U-Boot supplies its address 46*4882a593Smuzhiyunvia "bootaddr" environment variable. To check where the bootline should be 47*4882a593Smuzhiyunfor a specific board, go to the VxWorks BSP for that board, and look for a 48*4882a593Smuzhiyunparameter called BOOT_LINE_ADRS. Assign its value to "bootaddr". A typical 49*4882a593Smuzhiyunvalue for "bootaddr" is 0x101200. 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunIf a "bootargs" variable is defined, its content will be copied to the memory 52*4882a593Smuzhiyunlocation pointed by "bootaddr" as the kernel bootline. If "bootargs" is not 53*4882a593Smuzhiyunthere, command 'bootvx' can construct a valid bootline using the following 54*4882a593Smuzhiyunenvironments variables: bootdev, bootfile, ipaddr, netmask, serverip, 55*4882a593Smuzhiyungatewayip, hostname, othbootargs. 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunWhen using 'bootm', just define "bootargs" in the environment and U-Boot will 58*4882a593Smuzhiyunhandle bootline fix up for the kernel dtb automatically. 59*4882a593Smuzhiyun 60*4882a593SmuzhiyunSerial console 61*4882a593Smuzhiyun-------------- 62*4882a593SmuzhiyunIt's very common that VxWorks BSPs configure a different baud rate for the 63*4882a593Smuzhiyunserial console from what is being used by U-Boot. For example, VxWorks tends 64*4882a593Smuzhiyunto use 9600 as the default baud rate on all x86 BSPs while U-Boot uses 115200. 65*4882a593SmuzhiyunPlease configure both U-Boot and VxWorks to use the same baud rate, or it may 66*4882a593Smuzhiyunlook like VxWorks hangs somewhere as nothing outputs on the serial console. 67*4882a593Smuzhiyun 68*4882a593Smuzhiyunx86-specific information 69*4882a593Smuzhiyun------------------------ 70*4882a593SmuzhiyunBefore loading an x86 kernel, two additional environment variables need to be 71*4882a593Smuzhiyunprovided. They are "e820data" and "e820info", which represent the address of 72*4882a593SmuzhiyunE820 table and E820 information (defined by VxWorks) in system memory. 73*4882a593Smuzhiyun 74*4882a593SmuzhiyunCheck VxWorks kernel configuration to look for BIOS_E820_DATA_START and 75*4882a593SmuzhiyunBIOS_E820_INFO_START, and assign their values to "e820data" and "e820info" 76*4882a593Smuzhiyunaccordingly. If neither of these two are supplied, U-Boot assumes a default 77*4882a593Smuzhiyunlocation at 0x4000 for "e820data" and 0x4a00 for "e820info". Typical values 78*4882a593Smuzhiyunfor "e820data" and "e820info" are 0x104000 and 0x104a00. But there is one 79*4882a593Smuzhiyunexception on Intel Galileo, where "e820data" and "e820info" should be left 80*4882a593Smuzhiyununset, which assume the default location for VxWorks. 81*4882a593Smuzhiyun 82*4882a593SmuzhiyunNote since currently U-Boot does not support ACPI yet, VxWorks kernel must 83*4882a593Smuzhiyunbe configured to use MP table and virtual wire interrupt mode. This requires 84*4882a593SmuzhiyunINCLUDE_MPTABLE_BOOT_OP and INCLUDE_VIRTUAL_WIRE_MODE to be included in a 85*4882a593SmuzhiyunVxWorks kernel configuration. 86