1.
Auto Mount U- disk and SD card problem Solving:
http://blog.csdn.net/xdw1985829/article/details/6684968
The Mdev method of use .
in Linux We often use the U disk,SD card mount problem, each time manually mount or uninstall very troublesome, we can take the following methods to automatically mount or unload the U- disk, SD Card
@1: First add the following statement to the /ETC/INIT.D/RSC
Echo/sbin/mdev >/proc/sys/kernel/hotplug
@2: The file of the CV mdev.conf under /etc/ contains the following content
SD[A-Z][0-9] 0:0 666 @ (/etc/hotplug/insert.sh $MDEV $subsystem)
SD[A-Z] 0:0 666 $ (/etc/hotplug/remove.sh $MDEV $subsystem)
UB[A-Z][0-9] 0:0 666 @ (/etc/hotplug/insert.sh $MDEV $subsystem)
UB[A-Z] 0:0 666 $ (/etc/hotplug/remove.sh $MDEV $SUBSYSTEM)
MMCBLK[0-9]P[0-9] 0:0 666 @ (/etc/hotplug/insert.sh $MDEV $subsystem)
MMCBLK[0-9] 0:0 666 $ (/etc/hotplug/remove.sh $MDEV $subsystem)
@3: under/etc/, create the following folder HotPlug, and create the following file under the HotPlug directory, including the following content
Insert.sh:
If [-N "$"]; Then
if [-b/dev/$1]; Then
if [!-d/mnt/usb/sda1]; Then
Mkdir-p/mnt/usb/sda1
Fi
if [!-d/mnt/usb/$1]; Then
Mkdir-p/mnt/usb/$1
Fi
Mount/dev/$1/mnt/usb/$1
If [$?-ne 0]; Then
Rm-rf/mnt/usb/$1
Fi
Fi
Fi
Remove.sh:
mounts=$ (Mount | grep $ | cut-d "-F3)
Umount $MOUNTS
RM-RF $MOUNTS
automatic mounting of the SD card similarly:
@4: under/etc/, create The following folder HotPlug, and create the following file under the HotPlug directory, including the following content
Insertsd.sh:
If [-N "$"]; Then
if [-b/dev/$1]; Then
if [!-D/MNT/MMC/MMCBLK0P1]; Then
Mkdir-p/media
Fi
if [!-d/mnt/mmc/$1]; Then
Mkdir-p/mnt/mmc/$1
Fi
Mount/dev/$1/mnt/mmc/$1
If [$?-ne 0]; Then
Rm-rf/mnt/mmc/$1
Fi
Fi
Fi
Removesd.sh:
mounts=$ (Mount | grep $ | cut-d "-F3)
Umount $MOUNTS
RM-RF $MOUNTS
2.
Date of the Sun and moon years . seconds // Set system time
Hwclock-f/dev/rtc1-w// Write system time to /DEV/RTC1 in hardware RTC
Hwclock-f/dev/rtc1-s// synchronize RTC1 time to System time from hardware RTC to System
3.
The hwclock problem of RTC is resolved:
pcf8563 Drive with the
in the arch/arm/mach-nuc970/dev.c
Will:
static struct I2c_board_info __initdatanuc970_i2c_clients0[] =
{
#ifdef config_snd_soc_nau8822
{I2c_board_info ("nau8822", 0x1a),},
#endif
};
Switch
static struct I2c_board_info __initdatanuc970_i2c_clients0[] =
{
#ifdef config_snd_soc_nau8822
{I2c_board_info ("nau8822", 0x1a),},
#endif
{I2c_board_info ("pcf8563", 0x51)},// add pcf8563
};
After that, you will:
#ifdef CONFIG_I2C_BUS_NUC970_P0
I2c_register_board_info (0,nuc970_i2c_clients0, sizeof (NUC970_I2C_CLIENTS0)/sizeof (structi2c_board_info));
#endif
Switch
#ifdef CONFIG_I2C_BUS_NUC970_P0
I2c_register_board_info (1,nuc970_i2c_clients0, sizeof (NUC970_I2C_CLIENTS0)/sizeof (struct i2c_board_info));
I2c_register_board_info (0,nuc970_i2c_clients0, sizeof (NUC970_I2C_CLIENTS0)/sizeof (structi2c_board_info)); we're using I2C0.
#endif
compile the kernel, look at the log information in the kernel , to know pcf8563 RTC, is in the/DEV/RTC1
so the operation Hwclock operation of this RTC , to specify the file device ( with -f), or the direct Hwclock may be the corresponding /dev/ Rtc0
Date Month Day year . seconds
Hwclock-f/dev/rtc1-w
4.
The watchdog cannot reset the problem:
There is no 32.768KHZ crystal on the hardware circuit , but the watchdog in the kernel is the clock source provided by this 32.768KHZ crystal oscillator.
Solutions Two types:
The first: the hardware circuit is coupled with this 32.768KHZ crystal oscillator.
The second: on the software, in the kernel driver, read the register that overwrites the watchdog clock source, set it to pclk/4096 's clock source, which is 75mhz/4096.
in the driver/watchdog/nuc970_wdt.c
Will:
static int Nuc970wdt_start (Structwatchdog_device *wdd)
{
Unsignedint val = 0;
val|= (Wtre | WTE | WTR);
if (wdd->timeout< 2) {
val|= 0x5 << 8;
}else if (Wdd->timeout < 8) {
val|= 0x6 << 8;
}else {
val|= 0x7 << 8;
}
Unlock_regwriteprotect ();
__raw_writel (VAL,REG_WDT_CR);
Lock_regwriteprotect ();
Return0;
}
Modified to:
static int Nuc970wdt_start (Structwatchdog_device *wdd)
{
Unsignedint val = 0;
val|= (Wtre | WTE | WTR);
if (wdd->timeout< 2) {
val|= 0x5 << 8;
}else if (Wdd->timeout < 8) {
val|= 0x6 << 8;
}else {
val|= 0x7 << 8;
}
PRINTK (kern_info "/****************************wdt_start val = 0x%x ************\n", Val);//0x783//why
Unlock_regwriteprotect ();
__raw_writel (VAL,REG_WDT_CR);
__raw_writel ((__raw_readl (REG_CLK_DIV8) & (~0x300)) | 0x200, REG_CLK_DIV8); Why pclk/4096// Set the watchdog clock source
Lock_regwriteprotect ();
Return0;
}
Will:
The static int nuc970wdt_probe (Structplatform_device *pdev) function
Nuc970_wdd.timeout= 2; Default Time Out =2 sec (2.03)
Nuc970_wdd.min_timeout= 1;
Nuc970_wdd.max_timeout= 9; Max Time Out = 9 sec (8.03)
Modified to:
Nuc970_wdd.timeout = 2; Default Time Out = 2 sec (2.03)
Nuc970_wdd.timeout= 8; Why
Nuc970_wdd.min_timeout= 1; Min Time Out = 1 sec (0.53)
Nuc970_wdd.max_timeout= 9; Max Time Out = 9 sec (8.03)
nuc970_wdd.max_timeout= 14; Why
5.Qt Transplant
./configure-prefix/usr/local/qt4.8.3-arm-embedded Arm-release-shared-fast-no-largefile-qt-sql-sqlite- Qt3support-no-xmlpatterns-no-glib-no-phonon-no-mmx-no-3dnow-no-sse-no-sse2-no-svg-webkit-qt-zlib-qt-libtiff- Qt-libpng-qt-libjpeg-make libs-nomake examples-nomake Docs-nomake Demo-no-nis-no-cups-iconv-no-dbus-openssl-xpla tformqws/linux-arm-g++-little-endian-qt-freetype-depths 16,24,32-qt-gfx-linuxfb-qt-gfx-transformed- QT-GFX-MULTISCREEN-NO-GFX-VNC-NO-GFX-QVFB-QT-KBD-LINUXINPUT-NO-KBD-QVFB-ARMFPA-NO-MOUSE-QVFB- qt-mouse-linuxtp-qt-mouse-tslib-dqt_qlocale_uses_fcvt-i/usr/local/arm/tslib/include-l/usr/local/arm/tslib/ Lib-confirm-license
echo yes |./configure-prefix/usr/local/qt4.8.3-arm-release-no-largefile-opensource-embedded arm-stl-qt-freetype-q T-sql-sqlite-no-qt3support-no-svg-no-xmlpatterns-no-phonon-backend-no-scripttools-no-phonon-no-script- No-audio-backend-no-multimedia-no-openssl-nomake tools-nomake examples-nomake demos-nomakedocs-xplatform qws/ linux-arm-g++-no-webkit-no-qvfb-no-cups-no-neon-qt-gfx-vnc-no-gfx-multiscreen-qt-kbd-tty-qt-gfx-transformed- No-libtiff-no-libmng-qt-libpng-qt-mouse-pc-no-mouse-linuxtp-qt-mouse-tslib
This article from "Whylinux" blog, declined reprint!
NUC972 Migration Work Record