1. Setting up the network environment
1) Setting up the host network environment
#ifconfig eth1 192.168.16.111
2) Set up the Development Board network environment
>pri
>setenv ipaddr 192.168.16.233
>setenv ServerIP 192.168.16.111
>setenv Gatewayip 192.168.16.1
>ping 192.168.16.111
>saveenv
2. downloading files via TFTP
>tftp 0x40000000 Aaa.txt
3. Write your own u-boot by TFTP
1) Download the file to the Development Board
#cp u-boot.bin/tftpboot/put the compiled u-boot on the host TFTP server directory.
>tftp 0x40000000 u-boot.bin download u-boot to target machine
2) write Flash with u-boot command (first wipe, then write)
>nand Erase 0x0 0x60000 erase flash, wipe 0x60000 size from 0 address
>nand Write 0x40000000 0x0 0x60000 writes the file at the memory 0x40000000 address to the 0x0 address of Flash and writes the 0x60000 size.
4. Loading the kernel
1) Production Uimage
Arch/arm/boot/zimage Kernel Original
Make U-boot boot kernel uimage, u-boot/mkimage, Zimage, Uimage
#拷贝已编译过的u-boot/tools/mkimage to/usr/bin
#在内核源码目录下执行make Uimage
2) Install the kernel
#cp Arch/arm/boot/uimage/tftpboot
TFTP Download kernel image uimage to the start address of DRAM 1 0x40000000:
>tftp 0x40000000 Uimage
Boot the kernel
>bootm
3) Curing Core
>tftp 0x40000000 Uimage
>nand Erase 0x600000 0x500000
>nand Write 0x40000000 0x600000 0x500000
U-boot Startup Parameters
>setenv bootcmd ' NAND read 0x40000000 0x600000 0x500000; Bootm 0x40000000 '
5. Mounting the file system
1) Build NFS server, see Development environment Build 2.3 section
2) Restart Server for NFS
Service Portmap Restart
/etc/init.d/nfs-kernel-server restart
6. Configure the Development Board startup parameters
1) Set U-boot Start command
>setenv bootcmd tftp 40000000 uimage\; bootm\;
2) Set the kernel boot parameters to remotely mount the root file system on the host computer in NFS mode
>setenv Bootargs ' console=ttysac0,115200 root=/dev/nfs rw nfsroot=192.168.1.130:/nfs/mini_rootfs ip=192.168.16.20 0:192.168.1.130:192.168.1.1:255.255.255.0::eth0:off INIT=/LINUXRC '
-----------------------------------------
To set the interface for kernel IO:
Set the direction of the Gpio if the output is set at the same level:
Gpio_direction_input (s5pv210_gpj2 (0));
Gpio_direction_output (s5pv210_gpj2 (0), 0);
To get the level of the input pin:
Gpio_set_value (s5pv210_gpj2 (0), data);
Gpio_get_value (s5pv210_gpj2 (0));
Use of Gpio in two cores
1 Test if the GPIO port is valid int gpio_is_valid (int number);
2 Apply for a Gpio port of course before applying the configuration that is required to display the Pinmux of the Gpio port
int gpio_request (unsigned gpio, const char *label)
3 mark the use direction of gpio including input or output
/* Successfully returned 0 failed to return negative error value */
int gpio_direction_input (unsigned gpio);
int gpio_direction_output (unsigned gpio, int value);
4 Get the value of the Gpio pin and set the value of the Gpio pin (for output)
int Gpio_get_value (unsigned gpio);
void Gpio_set_value (unsigned gpio, int value);
5 Gpio used as interrupt port
int Gpio_to_irq (unsigned gpio);
The value returned is the interrupt number that can be passed to REQUEST_IRQ () and FREE_IRQ ()
The kernel converts a GPIO port into an interrupt by calling this function, and there is a similar approach in user space
6 Exporting Gpio ports to user space
int Gpio_export (unsigned gpio, bool direction_may_change);
The kernel can explicitly manage the export of GPIO ports that have been requested by the Gpio_request ().
The parameter direction_may_change indicates whether the user program allows the direction of the Gpio to be modified, if
The parameter Direction_may_change is true
/* Revoke the GPIO's export */
void Gpio_unexport ();
Remaining Linux-related notes