说明:
按照原子4.15版本步骤进行的,过程大部分与4.15类似,只有部分不一样
1、在configs文件夹下找到 mx6ull_14x14_evk_emmc_defconfig文件,使用 cp mx6ull_14x14_evk_emmc_defconfig mx6ull_14x14_emmc_defconfig,复制完成后打开mx6ull_14x14_emmc_defconfig,如下
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6ULL_14X14_EVK=y
CONFIG_NR_DRAM_BANKS=1
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ullevk/imximage.cfg"
CONFIG_SUPPORT_RAW_INITRD=y
CONFIG_BOUNCE_BUFFER=y
CONFIG_VIDEO=y
CONFIG_BOOTDELAY=3
CONFIG_BOARD_EARLY_INIT_F=y
更改下第3行和第4行,改完后如下
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6ULL_14X14_EMMC=y
CONFIG_NR_DRAM_BANKS=1
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ull_14x14_emmc/imximage.cfg"
CONFIG_SUPPORT_RAW_INITRD=y
CONFIG_BOUNCE_BUFFER=y
CONFIG_VIDEO=y
CONFIG_BOOTDELAY=3
CONFIG_BOARD_EARLY_INIT_F=y
2、找到uboot根目录下的include/configs,在此路径找到mx6ullevk.h 将此文件复制并且重命名为 mx6ull_14x14_emmc.h (cp mx6ullevk.h mx6ull_14x14_emmc.h),随后将此文件打开,并进行更改第8,9行,改完如下。
8 #ifndef__MX6ULL_14x14_EMMC_CONFIG_H
9 #define__MX6ULL_14x14_EMMC_CONFIG_H
3、在uboot的根目录下,进入board/freescale ,并将mx6ullevk文件夹内容全部复制,重命名为mx6ull_14x14_emmc, 进入此文件夹,进行下面几步操作:
a、将mx6ullevk.c文件改名为 mx6ull_14x14_emmc.c,
b、打开Makefile 将其改为 obj-y := mx6ull_14x14_emmc.o
c、打开Kconfig 将其更改为:
if TARGET_MX6ULL_14X14_EMMC
config SYS_BOARD
default"mx6ull_14x14_emmc"
config SYS_VENDOR
default"freescale"
config SYS_CONFIG_NAME
default"mx6ull_14x14_emmc"
config SYS_TEXT_BASE
default0x87800000
endif
d、打开MAINTAINERS 将其更改为:
MX6ULL_14x14_EMMC BOARD
M: PengFan <peng.fan@nxp.com>
S: Maintained
F: board/freescale/mx6ull_14x14_emmc/
F: include/configs/mx6ull_14x14_emmc.h
F: configs/mx6ull_14x14_emmc_defconfig
F: configs/mx6ull_14x14_evk_plugin_defconfig
e、打开imximage.cfg将第34行更改为:
34 PLUGIN board/freescale/mx6ull_14x14_emmc/plugin.bin0x00907000
4、在uboot根目录下的Makefile 中添加 ARCH = arm , CROSS_COMPILE = arm-linux-gnueabihf-
5、打开/arch/arm/mach-imx/mx6 目录,在Kconfig文件中添加 如下:
config TARGET_MX6ULL_14X14_EMMC
bool"Support mx6ull_14x14_emmc"
selectBOARD_LATE_INIT
selectDM
selectDM_THERMAL
selectMX6ULL
implyCMD_DM
source"board/freescale/mx6ull_14x14_emmc/Kconfig"
6、先使用make mx6ull_14x14_emmc_defconfig ,再使用make –j32进行编译(注意:在此过程中,可能会报错,原因是因为缺少BISON和)在编译前,先使用make distclean进行清除再进行编译。
编译完后 使用 grep –nR “mx6ull_14x14_emmc.h”查看是包括了此文件
第二篇:LCD相关参数与网络驱动更改
1、 LCD参数修改
在 uboot目录下打开 /board/freescale/mx6ull_14x14_emmc
修改mx6ull_14x14_emmc.c文件(根据自己LCD显示屏的实际参数修改)以下是我的屏幕参数
struct display_info_t const displays[] = {{
.bus= MX6UL_LCDIF1_BASE_ADDR,
.addr= 0,
.pixfmt= 24,
.detect= NULL,
.enable = do_enable_parallel_lcd,
.mode = {
.name = "ATK4384",
.xres = 800,
.yres = 480,
.pixclock = 32265,
.left_margin = 88,
.right_margin = 40,
.upper_margin = 32,
.lower_margin = 13,
.hsync_len = 48,
.vsync_len = 3,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED
} } };
重启板子
-Boot 2019.04 (May 28 2020 - 22:54:19+0800)
CPU: Freescale i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 48C
Reset cause: POR
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
unsupported panel TFT43AB
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
flash target is MMC:0
Net: Could not get PHY for FEC1: addr 1
Could not get PHY for FEC1: addr 1
eth-1: ethernet@020b4000, eth0:ethernet@02188000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
使用uboot指令查看panel的值
=> printenv panel
panel=TFT43AB
现将panel的值设置为与我们程序中改的一样ATK4384 保存并重启
=> setenv panel ATK4384
=> saveenv
Saving Environment to MMC... Writing toMMC(0)... OK
=>reset
U-Boot 2019.04 (May 28 2020 - 23:02:04+0800)
CPU: Freescale i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 51C
Reset cause: POR
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
Display: ATK4384 (800x480)
Video: 800x480x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
flash target is MMC:0
Net: Could not get PHY for FEC1: addr 1
Could not get PHY for FEC1: addr 1
eth-1: ethernet@020b4000, eth0:ethernet@02188000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
=>
这时候屏幕启动正常了。
2、 网络驱动 首先修改mx6ull_14x14_emmc.h文件,如下所示:
#ifndef __MX6ULL_14x14_EMMC_CONFIG_H
#define __MX6ULL_14x14_EMMC_CONFIG_H
#include <asm/arch/imx-regs.h>
#include <linux/sizes.h>
#include "mx6_common.h"
#include <asm/mach-imx/gpio.h>
#include "imx_env.h"
#define CONFIG_PHY_SMSC
#ifdef CONFIG_SECURE_BOOT
#ifndef CONFIG_CSF_SIZE
#define CONFIG_CSF_SIZE 0x4000
#endif
#endif
。。。
#ifdef CONFIG_FEC_MXC
#define CONFIG_CMD_MII
#define CONFIG_FEC_ENET_DEV 1
#if (CONFIG_FEC_ENET_DEV == 0)
#define IMX_FEC_BASE ENET_BASE_ADDR
#define CONFIG_FEC_MXC_PHYADDR 0x0
#define CONFIG_FEC_XCV_TYPE RMII
#define CONFIG_ETHPRIME "eth0"
#elif (CONFIG_FEC_ENET_DEV == 1)
#define IMX_FEC_BASE ENET2_BASE_ADDR
#define CONFIG_FEC_MXC_PHYADDR 0x1
#define CONFIG_FEC_XCV_TYPE RMII
#define CONFIG_ETHPRIME "eth1"
#endif
再修改mx6ull_14x14_emmc文件夹下的mx6ull_14x14_emmc.c文件,如下所示
//net_configs
#define ENET_CLK_PAD_CTRL(PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \
PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | \
PAD_CTL_SRE_FAST)
#define MDIO_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \
PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST | \
PAD_CTL_ODE)
#define ENET1_RESET IMX_GPIO_NR(5, 7)
#define ENET2_RESET IMX_GPIO_NR(5, 8)
static iomux_v3_cfg_t const fec1_pads[] = {
MX6_PAD_GPIO1_IO06__ENET1_MDIO| MUX_PAD_CTRL(MDIO_PAD_CTRL),
MX6_PAD_GPIO1_IO07__ENET1_MDC| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_TX_DATA0__ENET1_TDATA00| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_TX_DATA1__ENET1_TDATA01| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_TX_EN__ENET1_TX_EN| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_TX_CLK__ENET1_REF_CLK1| MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
MX6_PAD_ENET1_RX_DATA0__ENET1_RDATA00| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_RX_DATA1__ENET1_RDATA01| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_RX_ER__ENET1_RX_ER| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET1_RX_EN__ENET1_RX_EN| MUX_PAD_CTRL(ENET_PAD_CTRL),
//ENET1_RESET_PIN
MX6_PAD_SNVS_TAMPER7__GPIO5_IO07| MUX_PAD_CTRL(NO_PAD_CTRL),
};
static iomux_v3_cfg_t const fec2_pads[] = {
MX6_PAD_GPIO1_IO06__ENET2_MDIO| MUX_PAD_CTRL(MDIO_PAD_CTRL),
MX6_PAD_GPIO1_IO07__ENET2_MDC| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_TX_DATA0__ENET2_TDATA00| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_TX_DATA1__ENET2_TDATA01| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_TX_EN__ENET2_TX_EN| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_TX_CLK__ENET2_REF_CLK2| MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
MX6_PAD_ENET2_RX_DATA0__ENET2_RDATA00| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_DATA1__ENET2_RDATA01| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_ER__ENET2_RX_ER| MUX_PAD_CTRL(ENET_PAD_CTRL),
MX6_PAD_ENET2_RX_EN__ENET2_RX_EN| MUX_PAD_CTRL(ENET_PAD_CTRL),
//ENET2_RESET_PIN
MX6_PAD_SNVS_TAMPER8__GPIO5_IO08| MUX_PAD_CTRL(NO_PAD_CTRL),
};
static int setup_fec(int fec_id)
{
structiomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
intret;
if(fec_id == 0) {
imx_iomux_v3_setup_multiple_pads(fec1_pads,ARRAY_SIZE(fec1_pads));
gpio_request(ENET1_RESET,"enet1_reset");
gpio_direction_output(ENET1_RESET, 0);
mdelay(20);
gpio_direction_output(ENET1_RESET, 1);
if(check_module_fused(MX6_MODULE_ENET1))
return-1;
/*
* Use 50M anatop loopback REF_CLK1 for ENET1,
* clear gpr1[13], set gpr1[17].
*/
clrsetbits_le32(&iomuxc_regs->gpr[1],IOMUX_GPR1_FEC1_MASK,
IOMUX_GPR1_FEC1_CLOCK_MUX1_SEL_MASK);
}else {
imx_iomux_v3_setup_multiple_pads(fec2_pads,ARRAY_SIZE(fec2_pads));
gpio_request(ENET2_RESET,"enet1_reset");
gpio_direction_output(ENET2_RESET, 0);
mdelay(20);
gpio_direction_output(ENET2_RESET, 1);
if(check_module_fused(MX6_MODULE_ENET2))
return-1;
/*
* Use 50M anatop loopback REF_CLK2 for ENET2,
* clear gpr1[14], set gpr1[18].
*/
clrsetbits_le32(&iomuxc_regs->gpr[1],IOMUX_GPR1_FEC2_MASK,
IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
}
ret= enable_fec_anatop_clock(fec_id, ENET_50MHZ);
if(ret)
returnret;
enable_enet_clk(1);
return0;
}
最后在drivers/net/phyphy.c中添加软复位,如下所示 int genphy_update_link(struct phy_device *phydev)
{ unsigned int mii_reg;
#ifdef CONFIG_PHY_SMSC
staticint lan8720_flag = 0;
intbmcr_reg = 0;
if(lan8720_flag == 0){
bmcr_reg = phy_read(phydev,MDIO_DEVAD_NONE,MII_BMCR);
phy_write(phydev,MDIO_DEVAD_NONE,MII_BMCR,BMCR_RESET);
while(phy_read(phydev, MDIO_DEVAD_NONE,MII_BMCR)& 0x8000){
udelay(100);
}
phy_write(phydev,MDIO_DEVAD_NONE,MII_BMCR,bmcr_reg);
lan8720_flag = 1;
}
#endif
。。。。。。
以下不变
}
编译下载uboot ,并运行 U-Boot 2019.04 (May 29 2020 - 00:32:31+0800)
CPU: Freescale i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 46C
Reset cause: POR
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
Display: ATK4384 (800x480)
Video: 800x480x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
flash target is MMC:0
Net:
Error: ethernet@020b4000 address not set.
Error: ethernet@020b4000 address not set.
Error: ethernet@02188000 address not set.
eth-1: ethernet@020b4000
Error: ethernet@02188000 address not set.
, eth-1: ethernet@02188000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
可以看到上面的提示 都是没有给网卡设置mac地址的,下面给网卡设置mac地址
=> setenv eth1addr 00:11:22:fa:fb:fe
=> setenv ethaddr 00:11:22:fa:fb:fd
=> saveenv
Saving Environment to MMC... Writing toMMC(0)... OK
=> reset
resetting ...
=> setenv ethprime eth1
=> saveenv
Saving Environment to MMC... Writing toMMC(0)... OK
设置好相关的 ipaddr gatewayip netmask保存后重启,再进行ping的操作看是否能够ping通局域网内的ip,要是能ping通说明成功了!
=> setenv ipaddr 192.168.100.14
=> setenv gatewayip 192.168.100.1
=> setenv netmask 225.225.225.0
=> saveenv
Saving Environment to MMC... Writing toMMC(0)... OK
=> ping 192.168.100.1
ethernet@020b4000 Waiting for PHY auto negotiationto complete... done
Using ethernet@020b4000 device
host 192.168.100.1 is alive
=> ping 192.168.100.33
Using ethernet@020b4000 device
host 192.168.100.33 is alive
|