Host development system
Item | Address |
---|---|
OS image loaded at: | 0x00100000 |
OS image begins execution at: | 0x00101e38 |
Flash base address | 0xff000000 |
Monitor Flash offset | 0xff800000 |
TSEC1 base address | 0xe0002400 (IRQ: 13,14,18) |
TSEC2 base address | 0xe0002500 (IRQ: 19,20,24) |
Serial base address (8540) | 0xe0004500 (IRQ: 26) |
Serial base address (8560) | SCC1 IRQ(104, 112, 113) or SCC2 IRQ(105, 114, 115) |
Step 1: Build the BSP
You can build a BSP OS image from the source code. For instructions about building a BSP OS image, please refer to the chapter Working with a BSP in the Building Embedded Systems manual.
Step 2: Connect your hardware
1. Set up the board.
This BSP is set up for a PCI clock frequency of 33MHz. If you're using this setup, then the clock rates should be: CPU: 825 MHz CCB: 330 MHz DDR: 165 MHz LBC: 82 MHz Note: To change the PCI frequency for the Freescale MPC8540 ADS board to 66 MHz: 1. Change the jumper settings as described in the hardware manual. 2. Compile the ROM monitor to use a frequency of 66 MHz. 3. Add the -t66000000 option to the startup command line in your buildfile and rebuild your OS image.
3. Connect the other end of the serial cable to the first available serial port of your host machine (e.g. ser1 on a Neutrino host).
Note: If you have a Neutrino host with a serial mouse, you may have to move the mouse to the second serial port on your host, because some terminal programs require the first serial port.
On your host machine, start your favorite terminal program with these settings:
Then, apply power to the target. You should see output similar to the following:
U-Boot 1.1.0(pq3-20040423-r1) (Sep 29 2004 - 08:10:20) Freescale PowerPC Core: E500, Version: 2.0, (0x80200020) System: 8540, Version: 2.0, (0x80300020) Clocks: CPU: 825 MHz, CCB: 330 MHz, DDR: 165 MHz, LBC: 82 MHz L1 D-cache 32KB, L1 I-cache 32KB enabled. Board: ADS I2C: ready DRAM: SDRAM: 64 MB 128 MB FLASH: 16 MB L2 cache enabled: 256KB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: MOTO ENET0: PHY is Marvell 88E1011S (1410c62) MOTO ENET1: PHY is Marvell 88E1011S (1410c62) MOTO ENET2: PHY is Davicom DM9161E (181b881) MOTO ENET0, MOTO ENET1, MOTO ENET2 Hit any key to stop autoboot: 10 MPC8540ADS=> setenv ipaddr 192.168.200.2
Note: The version number for U-Boot is displayed as 1.1.0, but it's really 1.1.2.
Step 3: Setup the environment
On your target, type the following, filling in the appropriate IP addresses and ifs file:
MPC8540ADS=> setenv ipaddr 192.168.200.2 MPC8540ADS=> setenv serverip 192.168.200.1 MPC8540ADS=> setenv bootfile ifs-85x0ads.8540.raw MPC8540ADS=> setenv loadaddr 0x100000 MPC8540ADS=> setenv bootcmd 'tftpboot $loadaddr $bootfile; go $loadaddr' MPC8540ADS=> setenv bootdelay 2 MPC8540ADS=> saveenv Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... flash erase done Erased 1 sectors Writing to Flash... done Protected 1 sectors
Step 4: Boot the IFS image
You can use TFTP download (the default) or serial download to transfer the image from your host to the target:
Step 4A: TFTP download
This method requires a raw image, which the buildfile creates by default.
Once the above setup is complete, you can run the load command at the ~MPC8540ADS=> prompt to download the image:
MPC8540ADS=> boot
At this point you should see the ROM monitor download the boot image, indicated by a series of number signs. You'll also see output similar to this when it completes downloading:
Speed: 100, full duplex Using MOTO ENET0 device TFTP from server 192.168.200.1; our IP address is 192.168.200.2 Filename 'ifs-85x0ads.8540.raw' Load address: 0x100000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ########################################################## done done Bytes transferred = 3956736 (3c6000 hex) ## Starting application at 0x00100000 ...
Step 4B: Serial download
This method requires an SREC image. You have to modify the buildfile to create this format. Change this:
[virtual=ppcbe,raw]
to this:
[virtual=ppcbe,srec]
Rebuild the image. On your target, type:
MPC8540ADS=> setenv loads_echo 0 MPC8540ADS=> saveenv MPC8540ADS=> loads
On your host, copy the image to the serial port that's connected to the board. For example, on a Neutrino host:
cp ifs-85x0ads.8540.srec /dev/ser1
On a Windows host, you can use Hyperterminal's transfer feature to copy the image as a text file.
Note: The serial line shouldn't already be in use.
At this point, you should see the ROM monitor download the boot image, indicated by a series of dots. You'll also see output similar to this when it finishes downloading:
## First Load Addr = 0x00100000 ## Last Load Addr = 0x0023955B ## Total Size = 0x0013955C = 1283420 Bytes ## Start Addr = 0x00101E38 MPC8540ADS=>
Note: The start_addr is the startup entry point address. You can find this address from the mkifs utility (you'll need to use the __{{-v}}__ option to get this information from the mkifs utility; the __{{-v}}__ option is not a default option). For example: mkifs -v -r../install 85x0ads.8540.build ifs-85x0ads.8540.srec Offset Size Entry Ramoff Target=Host 100000 100 0 --- /usr/qnx630/target/qnx6/ppcbe/boot/sys/raw.boot 100100 100 ---- --- Startup-header 100200 10108 1022a0 --- /tmp/DAA426034 ... In this example, 1022a0 is the address to use.
System page at phys:0000c000 user:0000c000 kern:0000c000 Starting next program at v00133af4 Welcome to QNX Neutrino 6.3 on the PPC 8560ADS board #
You can test the OS simply by executing any shell builtin command or any command residing within the OS image (e.g. ls).
Once the initial image is running, you can update the OS image using the network and flash drivers. For sample command lines, please see the "Summary of driver commands" section.
devf-generic -s0xff000000,16M
2. To prepare the area for the partition.
Caution: Do not erase the last 8M -- it contains the ROM monitor. Use the -l (length) option to avoid these areas. To create a 1 MB partition, enter the following command:
flashctl -p/dev/fs0 -l1M -ve
3. Format the partition:
flashctl -p/dev/fs0p0 -l1M -vf
4. Slay, then restart the driver:
slay devf-generic & devf-generic -s0xff000000,16M &
You should now have a /fs0p0 directory which you can copy files to.
The following table summarizes the commands to launch the various drivers.
Component | Buildfile Command | Required Binaries | Required Libraries | Source Location |
---|---|---|---|---|
Startup | startup-85x0ads | . | . | src/hardware/startup/boards/85x0ads |
Serial for 8540 ADS | devc-ser8250-mpc8540 -e -c330000000 -b115200 0xe0004500,26 0xe0004600,26 | devc-ser8250-mpc8540 | . | src/hardware/devc/ser8250 |
Serial for 8560 ADS | devc-serppc8260 -e -b115200 scc1^1 | devc-serppc8260 | . | src/hardware/devc/serppc8260 |
Flash (NOR) | devf-generic -s0xff000000,16M | devf-generic flashctl | . | src/hardware/flash/boards/generic |
PCI | pci-mpc85xx | pci-mpc85xx pci | . | src/hardware/pci/mpc85xx |
Network | io-pkt-v4-hc -dmpc85xx mac=xxxxxxxxxxxx,verbose -ptcpip | io-pkt-v4-hc ifconfig | devnp-mpc85xx.so libsocket.so | "Binary form only:" prebuilt/ppcbe/lib/dll/devnp-mpc85xx.so |
Network:MPC Security Engine (AKA SEC) | io-pkt-v4-hc -dmpcsec -p tcpip-v6 ipsec -dmpc85xx mac=00112233AABB | io-pkt-v4-hc ifconfig | devnp-mpc85xx.so devnp-mpcsec.so libsocket.so | "Binary form only:" prebuilt/ppcbe/lib/dll/devnp-mpcsec.so |
Some of the drivers are commented out in the default buildfile. To use the drivers in the target hardware, you'll need to uncomment them in your buildfile, rebuild the image, and load the image into the board.
without encryption:
io-pkt-v4-hc -dmpc85xx mac=xxxxxxxxxxxx,verbose -ptcpip
with encryption in software:
io-pkt-v4-hc -p tcpip-v6 ipsec -dmpc85xx mac=00112233AABB
with encryption in hardware:
io-pkt-v4-hc -dmpcsec.so -p tcpip-v6 ipsec -dmpc85xx.so mac=00112233AABB
Workarounds: There are a few workarounds:
1. Ensure that no breaks are delivered to the target (if one is sent, sending a character to the target will clear the interrupt). See option 2. Note that a break can be also generated to the target (under the conditions of having mis-matched baud rates between the target and host).
2. Always ensure that at least one character is sent to the target immediately following the delivery of a break.
3. Disable the line status interrupt:
In the source file init.c, change line 84: write_8250(port[REG_IE], 0x0f);
to
write_8250(port[REG_IE], 0x0b);
This results in an unfortunate side effect: breaks, framing errors, parity errors, overrun errors, data ready interrupts Rx FIFO errors, Tx empty, Tx holding register empty will not generate Line Status interrupts. However, the LSR is also read with every character received, so processing of line status changes will not be completely disabled, just delayed until a character is received.
Item | Space |
---|---|
SMC1 Buffer Descriptor Table | 0x100 bytes |
SMC1 Data Buffers | 0x100 bytes |
SMC2 Buffer Descriptor Table | 0x100 bytes |
SMC2 Data Buffers | 0x100 bytes |
SMC1 Parameter RAM | 0x100 bytes |
SMC2 Parameter RAM | 0x100 bytes |
Item | Space |
---|---|
SCC1 Buffer Descriptor Table | 0x100 bytes |
SCC1 Data Buffers | 0x100 bytes |
SCC2 Buffer Descriptor Table | 0x100 bytes |
SCC2 Data Buffers | 0x100 bytes |
SCC3 Buffer Descriptor Table | 0x100 bytes |
SCC3 Data Buffers | 0x100 bytes |
SCC4 Buffer Descriptor Table | 0x100 bytes |
SCC4 Data Buffers | 0x100 bytes |