2016년 9월 1일 목요일

Cosmos OpenSSD Toggle Nand Board


CN1T8W-H27Q18 Toggle Nand Module Feature

l  Structure : 8 x 1Tb Toggle Nand (H27Q1T8YEB9R)
l  Capacity : 1 Tera Bytes

Shipping Materials

l  Toggle NAND Board   : 1ea

Wiki


Price :  740,000(VAT 별도)
help@crz-tech.com ( 031-701-5057)

2016년 6월 29일 수요일

Mango-AM335x-ST UART 통한 u-boot 부팅하기

http://www.mangoboard.com/main/view.asp?idx=693&pageNo=1&cate1=10&cate2=50&cate3= 




1.    참조 사이트



2.    부팅 모드


부팅 스위치를 아래와 1, 3번 ON , 나머지 OFF


3.    U-boot-spl.bin 파일과 u-boot.img 다운로드 하기




*The release package does not contain the binary for UART boot. Please follow the steps mentioned here for compiling u-boot and use the spl/u-boot-spl.bin file that is produced.
1.   Switch ON EVM with switch settings for UART boot. When “CCCC” characters appear on TeraTerm window, from the File Menu select Transfer --> XMODEM --> Send (1K mode)
2.   Select “u-boot-spl.bin” for the transfer
3.   After image is successfully downloaded, the ROM code will boot it.
4.   When “CCCC” characters appear on TeraTerm window, from the File Menu select Transfer --> YMODEM --> Send (1K mode)
5.   Select “u-boot.img” for the transfer
6.   After image is successfully downloaded, U-Boot will boot it.
7.   Hit enter and get to u-boot prompt “U-Boot# ”


위의 글을 참조하여 테스트 해 보았습니다.
Mango-AM335x-ST 보드에 UART to Serial 보드를 연결하고,
부팅 스위치를 1, 3번 ON, 나머지 off 상태에서 부팅을 합니다.
PC에 터미널 프로그램은 Tera Term을 설치하였습니다.

장치관리자에서 COM port를 확인 합니다.
저는 포트 번호 205번 입니다.
설정은 아래와 같이 합니다.


전원을 인가를 합니다. Uart 터미널 창에 “CCCC”가 메시지가 출력이 됩니다.

u-boot-spl.bin 바이너리를 다운로드 합니다.

Teratem에서 Transfer -> XMODEM -> Send 선택
u-boot-spl.bin 파일 선택

다운로드가 완료 후


터미널 창에 “CCCC”가 메시지가 출력이 됩니다.



메시지 “C”가 나오면 바로 YMODEM으로 u-boot.img파일을 전송합니다.

Transfer -> YMODEM -> Send 선택
u-boot.img 파일을 선택합니다.

u-boot.img 이미지 YMODEM 을 통하여 다운로드 과정

부팅 결과

4.    문제점 수정



u-boot-spl.bin 파일을 load하면 hang이 걸린다.

U-Boot SPL 2013.01.01 (Jun 29 2016 - 13:59:13)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
### ERROR ### Please RESET the board ###
코드를 참조하면
"common/spl/spl.c"
inline void hang(void)
{
        puts("### ERROR ### Please RESET the board ###\n");
        for (;;)
                ;
}

로그를 좀 더 살펴보면 ,
"include/common.h" 파일에서
#define CRZ_DEBUG
정의해서 다시 다운로드를 해 보면아래와 같이 메시지가 나옵니다.

U-Boot SPL 2013.01.01 (Jun 29 2016 - 15:24:11)
[CRZ] mux.c (366) enable_i2c0_pin_mux:
[CRZ] board.c (809) s_init:
[CRZ] board.c (94) read_eeprom:
[CRZ] mux.c (485) enable_board_pin_mux: AM3358, Start EVM
[CRZ] mux.c (378) enable_spi0_pin_mux:
[CRZ] mux.c (372) enable_nand_pin_mux:
[CRZ] board.c (874) s_init:
[CRZ] board.c (905) s_init:
[CRZ] spl.c (162) board_init_r:
[CRZ] timer.c (52) timer_init:
[CRZ] boot-common.c (59) spl_board_init:
[CRZ] mem.c (90) gpmc_init:
[CRZ] mem.c (66) enable_gpmc_cs_config:
[CRZ] board.c (445) am33xx_spl_board_init:
[CRZ] board.c (142) arch_misc_init:
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
[CRZ] boot-common.c (45) spl_boot_device: boot_params.omap_bootdevice: 0x41
[CRZ] spl.c (182) board_init_r: boot device - 65
[CRZ] spl.c (246) board_init_r: SPL: Un-supported Boot Device
### ERROR ### Please RESET the board ###


#define BOOT_DEVICE_UART        65
./arch/arm/include/asm/arch-am33xx/spl.h

"include/configs/am335x_evm.h" 파일에 아래와 같이 수정
#define CONFIG_SPL_YMODEM_SUPPORT


컴파일 후 이미지를 올리면 아래와 같이 부팅 되는 것을 볼 수 있습니다.
?CCCCCC
U-Boot SPL 2013.01.01 (Jun 29 2016 - 15:34:15)
[CRZ] mux.c (366) enable_i2c0_pin_mux:
[CRZ] board.c (809) s_init:
[CRZ] board.c (94) read_eeprom:
[CRZ] mux.c (485) enable_board_pin_mux: AM3358, Start EVM
[CRZ] mux.c (378) enable_spi0_pin_mux:
[CRZ] mux.c (372) enable_nand_pin_mux:
[CRZ] board.c (874) s_init:
[CRZ] board.c (905) s_init:
[CRZ] spl.c (162) board_init_r:
[CRZ] timer.c (52) timer_init:
[CRZ] boot-common.c (59) spl_board_init:
[CRZ] mem.c (90) gpmc_init:
[CRZ] mem.c (66) enable_gpmc_cs_config:
[CRZ] board.c (445) am33xx_spl_board_init:
[CRZ] board.c (142) arch_misc_init:
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
[CRZ] boot-common.c (45) spl_boot_device: boot_params.omap_bootdevice: 0x41
[CRZ] spl.c (182) board_init_r: boot device - 65
[CRZ] spl.c (219) board_init_r: BOOT_DEVICE_UART
CCxyzModem - CRC mode, 0(SOH)/474(STX)/0(CAN) packets, 6 retries
Loaded 482708 bytes
[CRZ] spl.c (252) board_init_r: Jumping to U-Boot
[CRZ] spl.c (133) jump_to_image_no_args: image entry point: 0x80800000


U-Boot 2013.01.01 (Jun 29 2016 - 15:34:15)

I2C:   ready
DRAM:  512 MiB
WARNING: Caches not enabled
[CRZ] board.c (955) board_init:
[CRZ] mux.c (378) enable_spi0_pin_mux:
[CRZ] mux.c (372) enable_nand_pin_mux:
[CRZ] board.c (926) check_reset_status: PRM_RSTST: 0x00000001
[CRZ] board.c (946) check_reset_status: Power-on reset has occurred.
[CRZ] board.c (968) board_init:
[CRZ] board.c (94) read_eeprom:
[CRZ] mem.c (90) gpmc_init:
[CRZ] mem.c (66) enable_gpmc_cs_config:
NAND:  [CRZ] nand.c (107) nand_init:
[CRZ] nand.c (87) nand_init_chip:
[CRZ] omap_gpmc.c (797) board_nand_init:
[CRZ] omap_gpmc.c (847) board_nand_init: AM33XX NAND_ECC_HW
[CRZ] nand_base.c (3240) nand_scan:
[CRZ] nand_base.c (2920) nand_scan_ident:
[CRZ] nand_base.c (2610) nand_get_flash_type:
[CRZ] nand_base.c (2686) nand_get_flash_type: chip->cellinfo: 0x10, extid: 0x95
[CRZ] nand_base.c (2746) nand_get_flash_type: mtd->writesize: 0x800
[CRZ] nand_base.c (2764) nand_get_flash_type: busw: 0x0
[CRZ] nand_base.c (2841) nand_get_flash_type: NAND_LARGE_BADBLOCK_POS
[CRZ] nand.c (53) nand_register:
256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

[CRZ] board.c (142) arch_misc_init:
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
[CRZ] board.c (982) board_late_init:
[CRZ] mux.c (378) enable_spi0_pin_mux:
[CRZ] mux.c (372) enable_nand_pin_mux:
Net:   [CRZ] board.c (1057) board_eth_init:
not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit enter key to stop autoboot:  0
U-Boot#
U-Boot#
U-Boot#
U-Boot#
U-Boot#



2016년 5월 11일 수요일

Mango-IMX6 7인치 감압식 LCD 터치 구동하기



1.    Mango-IMX6 7인치 감압식 LCD 터치 구동하기




1.1.    Mango-IMX6Q 1.2 버전



<1.2버전 보드>
이미지를 다운로드 받는다

$tar xf mango-imx6q-image-160216.tgz

$ cd image
$ cp imx6q-sabresd-tsc2007.dtb imx6q-sabresd.dtb



1.2.    Mango-IMX6Q 1.3 버전



<1.3 버전 보드>
커널 소스 수정
LCD Back Light GPIO : SD1_DAT2(GPIO1_19, PWM2)
LCD Power EN GPIO: ENET_TXD0 (GPIO1_30)

arch/arm/boot/dts/imx6qdl-sabresd.dtsi

             lcd@0 {
                           compatible = "fsl,lcd";
                           ipu_id = <0>;
                           disp_id = <0>;
                           default_ifmt = "BGR24";
                           pinctrl-names = "default";
                           pinctrl-0 = <&pinctrl_ipu1_1>;
                           power_en_gpio = <&gpio1 30 0>; /* Power EN */
                           backlight_ctl_gpio = <&gpio1 19 0>; /* Backlight  CTRL */
                           status = "okay";
             };

             pwm-backlight {
                           compatible = "pwm-backlight";
                           pwms = <&pwm2 0 50000>;
                           brightness-levels = <
                                        0  /*1  2  3  4  5  6*/  7  8  9
                                        10 11 12 13 14 15 16 17 18 19
                                        20 21 22 23 24 25 26 27 28 29
                                        30 31 32 33 34 35 36 37 38 39
                                        40 41 42 43 44 45 46 47 48 49
                                        50 51 52 53 54 55 56 57 58 59
                                        60 61 62 63 64 65 66 67 68 69
                                        70 71 72 73 74 75 76 77 78 79
                                        80 81 82 83 84 85 86 87 88 89
                                        90 91 92 93 94 95 96 97 98 99
                                        100
                                        >;
                           default-brightness-level = <94>;
             };

&pwm1 {
             pinctrl-names = "default";
             pinctrl-0 = <&pinctrl_pwm1_1>;
             status = "disabled";
};

&pwm2 {
             pinctrl-names = "default";
             pinctrl-0 = <&pinctrl_pwm2_1>;
             status = "okay";
};


#if 0
             mango-ts@38 {
                           compatible = "mango,mango-ts";
                 reg = <0x38>;
                 pinctrl-names = "default";
                 pinctrl-0 = <&pinctrl_mango_ts>;
                 interrupt-parent = <&gpio3>;
                 interrupts = <26 0>;
                          resets = <&mango_ts_reset>;
             };
#else
   touchscreen: tsc2007@4a {
       compatible = "ti,tsc2007";
       reg = <0x4a>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_mango_ts>;
       interrupt-parent = <&gpio3>;
       interrupts = <26 0>;
       gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;
       ti,x-plate-ohms = <660>;
       linux,wakeup;
   };
#endif

arch/arm/boot/dts/imx6qdl.dtsi 파일 수정
             pwm2 {
                           pinctrl_pwm2_1: pwm2grp-1 {
                           fsl,pins = <
                                                     MX6QDL_PAD_SD1_DAT2__PWM2_OUT 0x1b0b1
                                        >;
                           };
             };

수정을 합니다.
커널을 컴파일 합니다.

$ ./build_kernel

SD card Linux PC에 삽입 후 Write를 합니다.
 [icanjji@icanjji-Samsung-DeskTop-System image]$ dmesg | tail
[9858808.684792] usb 2-1.4: new full-speed USB device number 7 using ehci_hcd
[9858808.779530] cp210x 2-1.4:1.0: cp210x converter detected
[9858808.852309] usb 2-1.4: reset full-speed USB device number 7 using ehci_hcd
[9858808.945045] usb 2-1.4: cp210x converter now attached to ttyUSB0
[9906472.618868] sd 184:0:0:0: [sdg] 15628288 512-byte logical blocks: (8.00 GB/7.45 GiB)
[9906472.620360] sd 184:0:0:0: [sdg] No Caching mode page present
[9906472.620364] sd 184:0:0:0: [sdg] Assuming drive cache: write through
[9906472.622477] sd 184:0:0:0: [sdg] No Caching mode page present
[9906472.622481] sd 184:0:0:0: [sdg] Assuming drive cache: write through
[9906472.623242]  sdg: sdg1

1.3.    이미지 Write 방법



u-boot, kernel, 파일 시스템 모두 Write 방법
$ sudo ./sdwriter sdg imx6q

u-boot와 커널, dtb  파일만 Write 방법
$ sudo ./sdwriter sdg imx6q bin


1.4.    테스트 방법



Micro SD Card를 보드에 삽입
부팅 스위치
SW1 : 2번 ON , 나머지 OFF
SW2: 3,4,5 ON , 나머지 OFF

전원을 인가 합니다.

Debug 터미널 창에서 아무키나 누른 후 설정을 합니다.
U-Boot 2014.04-08648-g9d7bf9b-dirty (Jan 20 2016 - 17:47:14)

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz
CPU:   Temperature 25 C, calibration data: 0x5484b969
Reset cause: POR
Board: MX6-SabreSD
I2C:   ready
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
*** Warning - bad CRC, using default environment

Display: Mango-AT070 (800x480)
In:    serial
Out:   serial
Err:   serial
mmc2 is current device
unsupported boot devices
check_and_clean: reg 0, flag_set 0
Fastboot: Normal
SATA isn't buildin
Net:   FEC [PRIME]
Warning: failed to set MAC address

Normal Boot
Hit any key to stop autoboot:  0
=>
=>
=>
=>
=> setenv mmcargs 'setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot} video=mxcfb0:dev=lcd,MANGO-PRESS7,fbpix=BGR32,bpp=32'
=> save
Saving Environment to MMC...
Writing to MMC(2)... done
=> reset


setenv mmcargs 'setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot} video=mxcfb0:dev=lcd,MANGO-PRESS7,fbpix=BGR32,bpp=32'



커널 부팅 메시지에 아래와 같이 출력이 되면 인식이 된 것입니다.
input: TSC2007 Touchscreen as /devices/soc0/soc.1/2100000.aips-bus/21a4000.i2c/i2c-1/1-004a/input/input0
i2c-core: driver [mango-ts] using legacy suspend method
i2c-core: driver [mango-ts] using legacy resume method
i2c-core: driver [isl29023] using legacy suspend method
i2c-core: driver [isl29023] using legacy resume method

테스트 명령
ts_calibrate
ts_test