Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Development Strategy of DM8127 for Image recognition-- description of Migration of KERNEL

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Development Strategy of DM8127 for Image recognition-- description of Migration of KERNEL

Following the pace of the previous "Image recognition DM8127 Development Strategy-UBOOT Migration instructions", the last article of the DM8127 development strategy is about the cutting and porting of Kernel. Based on APPRO RDK3.8.0, we cut and migrate / ti_tools/ipnc_psp_arago/kernel, which is the linux-2.6.37 version:

First, the first step is to do the cutting work to delete redundant folders and files to facilitate the backup and preservation of the program at each stage.

1. In kernel/fs/hostf/Makefile, open the Makefile file and block # include arch/um/scripts/Makefile.rules, as shown in the path below

Then delete the kernel/arch/um folder, leaving only the contents of the following figure:

2. Delete the files in kernel/arch/x86 and keep only the contents of the following figure:

3. Delete the content in kernel/arch/arm/ and keep only the following figure:

4. Delete the files in kernel/arch/arm/mach-omap2/ that start with board-, and keep only the following board-xxx.c

Board-ti8148ipnc.c is the key platform file to be modified, and other irrelevant platform C files are removed.

5. Delete arch/arm/configs redundant platform configuration files:

Keep only ti8148_ipnc_ubifs_defconfig files

6. Delete the folders and files mentioned above, then the relevant script files need to be modified synchronously.

A, arch/arm/Makefile modification

Line 129 begins:

Ifeq ($(CONFIG_TY_KERNEL), y) (I block the contents in this way and do not compile)

Machine-$ (CONFIG_ARCH_AAEC2000): = aaec2000

Machine-$ (CONFIG_ARCH_AT91): = at91

Machine-$ (CONFIG_ARCH_BCMRING): = bcmring

Machine-$ (CONFIG_ARCH_CLPS711X): = clps711x

Machine-$ (CONFIG_ARCH_CNS3XXX): = cns3xxx

Machine-$ (CONFIG_ARCH_DAVINCI): = davinci

Machine-$ (CONFIG_ARCH_DOVE): = dove

Machine-$ (CONFIG_ARCH_EBSA110): = ebsa110

Machine-$ (CONFIG_ARCH_EP93XX): = ep93xx

Machine-$ (CONFIG_ARCH_GEMINI): = gemini

Machine-$ (CONFIG_ARCH_H720X): = h720x

Machine-$ (CONFIG_ARCH_INTEGRATOR): = integrator

Machine-$ (CONFIG_ARCH_IOP13XX): = iop13xx

Machine-$ (CONFIG_ARCH_IOP32X): = iop32x

Machine-$ (CONFIG_ARCH_IOP33X): = iop33x

Machine-$ (CONFIG_ARCH_IXP2000): = ixp2000

Machine-$ (CONFIG_ARCH_IXP23XX): = ixp23xx

Machine-$ (CONFIG_ARCH_IXP4XX): = ixp4xx

Machine-$ (CONFIG_ARCH_KIRKWOOD): = kirkwood

Machine-$ (CONFIG_ARCH_KS8695): = ks8695

Machine-$ (CONFIG_ARCH_LH7A40X): = lh7a40x

Machine-$ (CONFIG_ARCH_LOKI): = loki

Machine-$ (CONFIG_ARCH_LPC32XX): = lpc32xx

Machine-$ (CONFIG_ARCH_MMP): = mmp

Machine-$ (CONFIG_ARCH_MSM): = msm

Machine-$ (CONFIG_ARCH_MV78XX0): = mv78xx0

Machine-$ (CONFIG_ARCH_MX1): = imx

Machine-$ (CONFIG_ARCH_MX2): = imx

Machine-$ (CONFIG_ARCH_MX25): = mx25

Machine-$ (CONFIG_ARCH_MX3): = mx3

Machine-$ (CONFIG_ARCH_MX5): = mx5

Machine-$ (CONFIG_ARCH_MXC91231): = mxc91231

Machine-$ (CONFIG_ARCH_NETX): = netx

Machine-$ (CONFIG_ARCH_NOMADIK): = nomadik

Machine-$ (CONFIG_ARCH_NS9XXX): = ns9xxx

Machine-$ (CONFIG_ARCH_OMAP1): = omap1

Machine-$ (CONFIG_ARCH_OMAP2): = omap2

Machine-$ (CONFIG_ARCH_OMAP3): = omap2

Machine-$ (CONFIG_ARCH_OMAP4): = omap2

Machine-$ (CONFIG_ARCH_ORION5X): = orion5x

Machine-$ (CONFIG_ARCH_PNX4008): = pnx4008

Machine-$ (CONFIG_ARCH_PXA): = pxa

Machine-$ (CONFIG_ARCH_REALVIEW): = realview

Machine-$ (CONFIG_ARCH_RPC): = rpc

Machine-$ (CONFIG_ARCH_S3C2410): = s3c2410 s3c2400 s3c2412 s3c2416 s3c2440 s3c2443

Machine-$ (CONFIG_ARCH_S3C24A0): = s3c24a0

Machine-$ (CONFIG_ARCH_S3C64XX): = s3c64xx

Machine-$ (CONFIG_ARCH_S5P64X0): = s5p64x0

Machine-$ (CONFIG_ARCH_S5P6442): = s5p6442

Machine-$ (CONFIG_ARCH_S5PC100): = s5pc100

Machine-$ (CONFIG_ARCH_S5PV210): = s5pv210

Machine-$ (CONFIG_ARCH_S5PV310): = s5pv310

Machine-$ (CONFIG_ARCH_SA1100): = sa1100

Machine-$ (CONFIG_ARCH_SHARK): = shark

Machine-$ (CONFIG_ARCH_SHMOBILE): = shmobile

Machine-$ (CONFIG_ARCH_STMP378X): = stmp378x

Machine-$ (CONFIG_ARCH_STMP37XX): = stmp37xx

Machine-$ (CONFIG_ARCH_TCC8K): = tcc8k

Machine-$ (CONFIG_ARCH_TEGRA): = tegra

Machine-$ (CONFIG_ARCH_U300): = U300

Machine-$ (CONFIG_ARCH_U8500): = ux500

Machine-$ (CONFIG_ARCH_VERSATILE): = versatile

Machine-$ (CONFIG_ARCH_VEXPRESS): = vexpress

Machine-$ (CONFIG_ARCH_W90X900): = w90x900

Machine-$ (CONFIG_ARCH_NUC93X): = nuc93x

Machine-$ (CONFIG_FOOTBRIDGE): = footbridge

Machine-$ (CONFIG_MACH_SPEAR300): = spear3xx

Machine-$ (CONFIG_MACH_SPEAR310): = spear3xx

Machine-$ (CONFIG_MACH_SPEAR320): = spear3xx

Machine-$ (CONFIG_MACH_SPEAR600): = spear6xx

Endif

Machine-$ (CONFIG_ARCHTI81XX): = omap2 (here the omap2 corresponding to the TI81XX to be compiled is extracted)

(and the following one uses # to shield unwanted platforms)

# Platform directory name. This list is sorted alphanumerically

# by CONFIG* macro name.

# plat-$ (CONFIG_ARCH_MXC): = mxc

Plat-$ (CONFIG_ARCH_OMAP): = omap (compilation is required here and cannot be shielded)

# plat-$ (CONFIG_ARCH_S3C64XX): = samsung

# plat-$ (CONFIG_ARCH_STMP3XXX): = stmp3xxx

# plat-$ (CONFIG_ARCH_TCC_926): = tcc

# plat-$ (CONFIG_PLAT_IOP): = iop

# plat-$ (CONFIG_PLAT_NOMADIK): = nomadik

# plat-$ (CONFIG_PLAT_ORION): = orion

# plat-$ (CONFIG_PLAT_PXA): = pxa

# plat-$ (CONFIG_PLAT_S3C24XX): = s3c24xx samsung

# plat-$ (CONFIG_PLAT_S5P): = s5p samsung

# plat-$ (CONFIG_PLAT_SPEAR): = spear

# plat-$ (CONFIG_PLAT_VERSATILE): = versatile

B, arch/arm/Kconfig modification

Start at line 869:

(use the # sign to block irrelevant platform Kconfig files so that they do not participate in compilation)

# source "arch/arm/mach-aaec2000/Kconfig"

# source "arch/arm/mach-at91/Kconfig"

# source "arch/arm/mach-bcmring/Kconfig"

# source "arch/arm/mach-clps711x/Kconfig"

# source "arch/arm/mach-cns3xxx/Kconfig"

# source "arch/arm/mach-davinci/Kconfig"

# source "arch/arm/mach-dove/Kconfig"

# source "arch/arm/mach-ep93xx/Kconfig"

# source "arch/arm/mach-footbridge/Kconfig"

# source "arch/arm/mach-gemini/Kconfig"

# source "arch/arm/mach-h720x/Kconfig"

# source "arch/arm/mach-integrator/Kconfig"

# source "arch/arm/mach-iop32x/Kconfig"

# source "arch/arm/mach-iop33x/Kconfig"

# source "arch/arm/mach-iop13xx/Kconfig"

# source "arch/arm/mach-ixp4xx/Kconfig"

# source "arch/arm/mach-ixp2000/Kconfig"

# source "arch/arm/mach-ixp23xx/Kconfig"

# source "arch/arm/mach-kirkwood/Kconfig"

# source "arch/arm/mach-ks8695/Kconfig"

# source "arch/arm/mach-lh7a40x/Kconfig"

# source "arch/arm/mach-loki/Kconfig"

# source "arch/arm/mach-lpc32xx/Kconfig"

# source "arch/arm/mach-msm/Kconfig"

# source "arch/arm/mach-mv78xx0/Kconfig"

# source "arch/arm/plat-mxc/Kconfig"

# source "arch/arm/mach-netx/Kconfig"

# source "arch/arm/mach-nomadik/Kconfig"

# source "arch/arm/plat-nomadik/Kconfig"

# source "arch/arm/mach-ns9xxx/Kconfig"

# source "arch/arm/mach-nuc93x/Kconfig"

Source "arch/arm/plat-omap/Kconfig"

# source "arch/arm/mach-omap1/Kconfig"

Source "arch/arm/mach-omap2/Kconfig" (this is for DM8127 platform and cannot be blocked)

# source "arch/arm/mach-orion5x/Kconfig"

# source "arch/arm/mach-pxa/Kconfig"

# source "arch/arm/plat-pxa/Kconfig"

# source "arch/arm/mach-mmp/Kconfig"

# source "arch/arm/mach-realview/Kconfig"

# source "arch/arm/mach-sa1100/Kconfig"

# source "arch/arm/plat-samsung/Kconfig"

# source "arch/arm/plat-s3c24xx/Kconfig"

# source "arch/arm/plat-s5p/Kconfig"

# source "arch/arm/plat-spear/Kconfig"

# source "arch/arm/plat-tcc/Kconfig"

# if ARCH_S3C2410

# source "arch/arm/mach-s3c2400/Kconfig"

# source "arch/arm/mach-s3c2410/Kconfig"

# source "arch/arm/mach-s3c2412/Kconfig"

# source "arch/arm/mach-s3c2416/Kconfig"

# source "arch/arm/mach-s3c2440/Kconfig"

# source "arch/arm/mach-s3c2443/Kconfig"

# endif

# if ARCH_S3C64XX

# source "arch/arm/mach-s3c64xx/Kconfig"

# endif

# source "arch/arm/mach-s5p64x0/Kconfig"

# source "arch/arm/mach-s5p6442/Kconfig"

# source "arch/arm/mach-s5pc100/Kconfig"

# source "arch/arm/mach-s5pv210/Kconfig"

# source "arch/arm/mach-s5pv310/Kconfig"

# source "arch/arm/mach-shmobile/Kconfig"

# source "arch/arm/plat-stmp3xxx/Kconfig"

# source "arch/arm/mach-tegra/Kconfig"

# source "arch/arm/mach-u300/Kconfig"

# source "arch/arm/mach-ux500/Kconfig"

# source "arch/arm/mach-versatile/Kconfig"

# source "arch/arm/mach-vexpress/Kconfig"

# source "arch/arm/mach-w90x900/Kconfig"

In the face of the modification of arch/arm/Kconfig, it is basically guaranteed that the irrelevant platform is removed from the kernel.

7. There are two other points to note in compilation mentioned:

In the ubuntu16.04 version of the virtual machine environment, in addition to the # apt-get install libncurses (note note) installation mentioned in the "Image recognition DM8127 Development Guide-Development Environment Building", there is another area that needs to be modified:

Kernel source kernel/kernel/timeconst.pl

Line 373 needs to be modified:

# if (! defined (@ val)) {# Jingbo (shielded here)

If ((! @ val)) {(changed to this)

Otherwise, we will not be able to compile linux-2.6.37 in our ubuntu16.04.

8. Kernel compilation also requires u-boot 's mkimage tool

I would like to mention here that in the RDK package, when compiling kernel, you must first compile u-boot mentioned above, that is, normal ubootbin, and you cannot use ubootclean, otherwise, compiling kernel here will fail, because when compiling kernel to get uImage binary BIN files, you need to use tools in uboot, such as the mkimage tool.

II. Compilation work

I mentioned the compilation process of DM8127 in "Image recognition DM8127 Development Strategy-- Analysis and compilation of RDK Software Architecture". We see that there are three compilation scripts related to kernel.

Build_3_kernel-menuconfig.sh 、 build_3_kernel-all.sh 、 build_3_kernel-tmp.sh

Here is not a cumbersome introduction, see the link article:

Https://blog.51cto.com/zjbintsystem/2043380

There is a detailed description of these three .sh script functions.

III. Software modification of DM8127 platform

There are three important files related to the platform. Arch/arm/mach-omap2/board-ti8148ipnc.c, devices.c and mux814x.c are still pin multiplexing issues. Some PIN pins in DM8127 are used to connect CMOS, but they cannot be configured in GPIO mode, and some PIN pins are used as HDMI video output, nor can they be configured into two groups of GPIO,MMC. We only need the first group of MMC1 to do SD card signal interface, which cannot be configured as GPIO here. The second group of MMC2 we do not want to support two SD card signals, can be configured to GPIO mode, and gpmc_ad must be configured to connect to the NAND FLASH interface, and so on. These functional definitions are first done in these three files, pay attention to the mux814x.c array struct omap_mux _ _ initdata ti814x_muxmodes [], which involves other DM385,TI811X platforms, etc., and the source code prompts which line of definition is not needed.

Here's an example:

In mux814x.c, add after ti814x_muxmodes []

_ TI814X_MUXENTRY (MMC2_DAT3, 0

MMC2_DAT3, NULL, GP2_5_work_state

NULL, NULL), (we want to use GP2_5 as GPIO for LED lamp control)

/ manual reset/

_ TI814X_MUXENTRY (OSC_WAKE, 0

"osc_wake", "spi1_cs1", NULL, NULL

"timer5_mux1", "GP1_7_manual_reset", NULL, NULL)

(GP1_7 we use for keystroke input)

We add the format _ TI814X_MUXENTRY later. In fact, it has already been defined before, which can be found by looking for MMC2_DAT3 and OSC_WAKE. We add it again here, but we don't want to destroy the software architecture of TI, and add our information: GP2_5_work_state and GP1_7_manual_reset. Then if you add these two sentences to ti814x_muxmodes [], you must add them after the board-ti8148ipnc.c ti8148_ipnc_init () function.

/ work state/

Omap_mux_init_signal ("GP2_5_work_state", TI814X_PIN_OUTPUT_PULL_DIS)

Error = gpio_request (GP2_5_WORK_STATE, "WORK_STATE"); if (error < 0) {printk (KERN_ERR "% s: failed to request GP2_5_WORK_STATE for WORK_STATE":% d\ n", _ _ func__, error); return;} / * manual reset*/omap_mux_init_signal ("GP1_7_manual_reset", TI814X_PIN_INPUT_PULL_UP) Error = gpio_request (GP1_7_MANUAL_RESET, "MANUAL_RESET"); if (error < 0) {printk (KERN_ERR "% s: failed to request GP1_7_MANUAL_RESET for MANUAL_RESET":% d\ n", _ _ func__, error); return;}

/ work state/

Gpio_direction_output (GP2_5_WORK_STATE, 1); (here must be configured in output mode)

/ manual reset/

Gpio_direction_input (GP1_7_MANUAL_RESET); (here must be configured into input mode)

Where:

# define GP2_5_WORK_STATE (69) / / GP2_5 work state

# define GP1_7_MANUAL_RESET (39) / / GP1_7 manual reset

First, omap_mux_init_signal () calls ti814x_muxmodes [], then the GP2_5 pin is configured to GPIO output mode, and GP1_7 is configured to GPIO input mode. At the same time, you must call the gpio_request function to apply before you can use it.

It is mentioned here that the TI DM8127 4 group GPIO index is managed as follows: the first group GPIO0 is 0-31, the second group GPIO1 is 32-63, the third group GPIO2 is 64-95, and the fourth group GPIO3 is 96-127s. So the macro definition value of GP2_5 above is 69 (69-32-32), and the macro definition of GP1_7 is 39 (39-32). I should be able to read it.

Similarly, arch/arm/mach-omap2/devices.c does similar pin configuration for each functional module. For example, if DM8127 supports CAN bus, then:

Static void ti814x_d_can_init (unsigned int instance)

{

Omap_mux_init_signal ("dcan0_tx.dcan0_tx", 0)

Omap_mux_init_signal ("dcan0_rx.dcan0_rx", TI814X_INPUT_EN |

TI814X_PULL_UP)

D_can_hw_raminit (instance)

Platform_device_register & ti814x_d_can0_device)

}

Configure, and initialize by calling ti814x_d_can_init () in the omap2_init_devices () function. The kernel runs first to initialize the ti8148_ipnc_init () function in arch/arm/mach-omap2/board-ti8148ipnc.c and the omap2_init_devices () function in arch/arm/mach-omap2/devices.c. After the functional configuration of the DM8127 pin, the kernel begins to initialize the corresponding peripheral chip (driver).

In addition to the pin multiplexing register can be configured in the CORTEX-A8 core, the other two M3 cores (M3-ISS and M3-HDVPSS) can also configure the pin multiplexing register, which should be noted and annoyed. Sometimes we configure the registers in the kernel, as a result, when we run APP, we find that some pins are not what we want at all. Later, we found that the two CORTEX-M3 cores are also configuring some registers. M3-ISS corresponds to ti_tools/iss_03_80_00_00/packages/ti/psp,M3-HDVPSS and corresponds to ti_tools/hdvpss_01_00_01_37/packages/ti/psp in the source code.

In the kernel, in addition to the above platform configuration work, there are a lot of peripheral initialization work, there is no need to write in detail here, these peripherals initialization online article reference. The kernel is running, a way to mount the virtual machine host / home/davinci/dm8127/v3.8.0/Soure/ipnc_rdk/target/filesys as a NFS file system:

Then debug the linux application. The other is to use build_7_ubifs.sh to make the BIN file dm8127_ubifs.bin of the ubifs file system (see my https://blog.51cto.com/zjbintsystem/2043380 article introduction)

Burn to NAND FLASH to run production-level programs.

The whole DM8127 development strategy can close the mouth at this point. Our company's development task focuses on the research and development of the new platform. Whether the new platform is successful or not, we can only take a chance. The current economic situation is very bad for physical enterprises that do product design, especially the crazy price increases in taxes, labor and electronic materials. Now it is March 2018, and we have not seen the momentum of price reduction. In fact, the most fundamental reason is that the nuclear-powered money printing machine (for example, netizens) is too terrible, this crazy robbery on the bottom of the people, how to put it? If enterprises want to survive, the price of raw materials must rise, otherwise they will not be able to increase the wages of these hard-working employees, they also want to live, everything is crazy to raise prices, a chain reaction. On the other hand, virtual products and financial pyramid schemes are widely advocated for the purpose of finding leeks. There is also a technical slogan, crazy deceptive financing, such as AI, so far there is not a good embedded platform that can recognize people's faces, characteristic behaviors, license plates and so on accurately and quickly in different environments. Because the power consumption and performance of the source embedded chip is right there, it can't deceive us. However, the popularity of AI is coming to an end, and the pigs flying in the sky in the past two years of AI have soon been replaced by another block chain (in China, it is a variant of financial pyramid scheme, which is bound to mutate). In fact, there is no other phenomenon of depression and chaos in the real economy that is more worrying. We do not know whether the progress and awakening of science and technology can prevent this phenomenon from happening again.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report