ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
2013年6月22日 星期六
Sensation 開始,,
花 790 買 ADATA 32G C10 的 microsd card
發現...mic 音量太小...
稍微操作一下,就會熱,操作久一點的話 (about 5min),連面板都感覺得到熱度。
反應有點頓。
面板邊邊很容易誤觸。
音量button 和 usb 孔在同一側,車架架具不可以太寬。
2013年6月21日 星期五
arm-eabi-readelf 列出用到的 so (android 的 ldd)
如果要看一個 執行 檔或是 so 有用到什麼 so. (相依)。
可以用 ldd
android 的 tool 好像沒有 arm, elf 用的 ldd。
但是有 arm-eabi-readelf
用
可以列出參考到的 so。
ref: http://stackoverflow.com/questions/10052041/how-to-list-library-dependencies-of-a-non-native-binary
用 objdump -p 也可以,
而且不用裝 cross-tool,host 端的 building tool 舊可以了。
-- readelf 就要跟 target 同一平台才行 (例如 arm...)
可以用 ldd
android 的 tool 好像沒有 arm, elf 用的 ldd。
但是有 arm-eabi-readelf
用
arm-eabi-readelf -d
可以列出參考到的 so。
$ arm-eabi-readelf -d system/bin/sh Dynamic section at offset 0x1342c contains 24 entries: Tag Type Name/Value 0x00000003 (PLTGOT) 0x1b6fc 0x00000002 (PLTRELSZ) 672 (bytes) 0x00000017 (JMPREL) 0x8ee4 0x00000014 (PLTREL) REL 0x00000011 (REL) 0x9184 0x00000012 (RELSZ) 56 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000015 (DEBUG) 0x0 0x00000006 (SYMTAB) 0x8464 0x0000000b (SYMENT) 16 (bytes) 0x00000005 (STRTAB) 0x8b24 0x0000000a (STRSZ) 958 (bytes) 0x00000004 (HASH) 0x8128 0x00000001 (NEEDED) Shared library: [libc.so] 0x00000001 (NEEDED) Shared library: [libstdc++.so] 0x00000001 (NEEDED) Shared library: [libm.so] 0x00000020 (PREINIT_ARRAY) 0x1b000 0x00000021 (PREINIT_ARRAYSZ) 0x8 0x00000019 (INIT_ARRAY) 0x1b008 0x0000001b (INIT_ARRAYSZ) 8 (bytes) 0x0000001a (FINI_ARRAY) 0x1b010 0x0000001c (FINI_ARRAYSZ) 8 (bytes) 0x0000001e (FLAGS) 0x00000000 (NULL) 0x0其中標示 (NEEDED) 的部份,就是參考到的 so。
ref: http://stackoverflow.com/questions/10052041/how-to-list-library-dependencies-of-a-non-native-binary
用 objdump -p 也可以,
而且不用裝 cross-tool,host 端的 building tool 舊可以了。
-- readelf 就要跟 target 同一平台才行 (例如 arm...)
新版 uboot 的 fastboot command emmc function config 改了..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/include/configs/mx53_loco_android.h b/include/configs/mx53_loco_android.h | |
index 3613af2..e88f7be 100644 | |
--- a/include/configs/mx53_loco_android.h | |
+++ b/include/configs/mx53_loco_android.h | |
@@ -80,7 +80,7 @@ | |
#define CONFIG_USB_DEVICE | |
#define CONFIG_FASTBOOT 1 | |
#define CONFIG_IMX_UDC 1 | |
-#define CONFIG_FASTBOOT_STORAGE_EMMC | |
+#define CONFIG_FASTBOOT_STORAGE_EMMC_SATA | |
#define CONFIG_FASTBOOT_VENDOR_ID 0xbb4 | |
#define CONFIG_FASTBOOT_PRODUCT_ID 0xc01 | |
#define CONFIG_FASTBOOT_BCD_DEVICE 0x311 | |
@@ -89,7 +89,8 @@ | |
#define CONFIG_FASTBOOT_CONFIGURATION_STR "Android fastboot" | |
#define CONFIG_FASTBOOT_INTERFACE_STR "Android fastboot" | |
#define CONFIG_FASTBOOT_SERIAL_NUM "12345" | |
-#define CONFIG_FASTBOOT_TRANSFER_BUF 0x80000000 | |
+#define CONFIG_FASTBOOT_SATA_NO 0 | |
+#define CONFIG_FASTBOOT_TRANSFER_BUF 0x80000000 | |
#define CONFIG_FASTBOOT_TRANSFER_BUF_SIZE 0x9400000 /* 148M byte */ | |
#define CONFIG_ANDROID_RECOVERY | |
@@ -100,6 +101,8 @@ | |
"run bootargs_base bootargs_android_recovery;mmc read 0 ${loadaddr} 0x800 0x2000;bootm" | |
#define CONFIG_ANDROID_RECOVERY_CMD_FILE "/recovery/command" | |
+#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 2 | |
+#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 4 | |
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6 | |
/* allow to overwrite serial and ethaddr */ | |
@@ -233,7 +236,7 @@ | |
/* detect whether ESDHC1 or ESDHC3 is boot device */ | |
#define CONFIG_DYNAMIC_MMC_DEVNO | |
- #define CONFIG_BOOT_PARTITION_ACCESS | |
+ #undef CONFIG_BOOT_PARTITION_ACCESS | |
#define CONFIG_EMMC_DDR_PORT_DETECT | |
#define CONFIG_EMMC_DDR_MODE | |
/* port 1 (ESDHC3) is 8 bit */ |
2013年6月20日 星期四
Display port and interface
DI : Display Interface, 用來連接 外部的 display, 系統有兩個這個 interface
DP : Display Processor, 處理需要送給 DI 的資料。
DC : Display Controller, 控制 Display Port (Interface ?)
fb 在 blank/unblank 時,會呼叫 mxcfb_set_par( ) 重新設定 framebuffer parameter 和 operation mode
接下來要從 kernel 的 mxcdi0fb 來看各 port 的 format 決定。
boot command 傳入的option 在mxcfb_option_setup( ) 使用.用來設定 ipu_di_pix_fmt (di 應該就上面的 display interface.)
ioctl 的 argument 很多..
有關這個 ipu_di_pix_fmt ...
libgralloc/framebuffer 裡的 dual_disp 參數,大多(只是?) 用來檢查有沒有超過 memory bandwidth
DP : Display Processor, 處理需要送給 DI 的資料。
DC : Display Controller, 控制 Display Port (Interface ?)
fb 在 blank/unblank 時,會呼叫 mxcfb_set_par( ) 重新設定 framebuffer parameter 和 operation mode
接下來要從 kernel 的 mxcdi0fb 來看各 port 的 format 決定。
boot command 傳入的option 在mxcfb_option_setup( ) 使用.用來設定 ipu_di_pix_fmt (di 應該就上面的 display interface.)
ioctl 的 argument 很多..
有關這個 ipu_di_pix_fmt ...
libgralloc/framebuffer 裡的 dual_disp 參數,大多(只是?) 用來檢查有沒有超過 memory bandwidth
#define SINGLE_DISPLAY_CAPABILITY (1920 * 1080 * 60) #define DUAL_DISPLAY_CAPABILITY (1920 * 1080 * 30)
- LCD : fb0 : DISP3 BG
- TVOUT : fb1 : DISP3 BG - DI1
- --- : fb2 : DISP3 FB
2013年6月19日 星期三
Display:
Set:
也就是說..從
所以把 1-layer-fb 寫入 fb0/fsl_disp_property,
fb1/fsl_disp_property 就會是 2-layer-fb-bg
把 l-layer-fb 寫入 fb1/fsl_disp_property
fb0/fsl_disp_property 就會是 2-layer-fb-bg
kernel/driver/video/mxc/mxc_ipuv3_fb.c
-- swap_disp_chan()
2V1U Mode
fb0 : 2-layer-fb-bg
改 1-layer-fb 後,..
UI 兩邊 OK, VIDEO 只有顯示在 TVOUT (OK)
- MEM_BG_SYNC : 2-layer-fb-bg
- MEM_FG_SYNC : 2-layer-fb-fg
- MEM_DC_SYNC : 1-layer-fb
Set:
- MEM_BG_SYNC --> 1-layer-fb
- MEM_DC_SYNC --> 2-layer-fb-bg
也就是說..從
- 2-layer-fg-bg --> 1-layer-fb
- 1-layer-fb --> 2-layer-fb-bg
所以把 1-layer-fb 寫入 fb0/fsl_disp_property,
fb1/fsl_disp_property 就會是 2-layer-fb-bg
把 l-layer-fb 寫入 fb1/fsl_disp_property
fb0/fsl_disp_property 就會是 2-layer-fb-bg
kernel/driver/video/mxc/mxc_ipuv3_fb.c
-- swap_disp_chan()
2V1U Mode
fb0 : 2-layer-fb-bg
改 1-layer-fb 後,..
UI 兩邊 OK, VIDEO 只有顯示在 TVOUT (OK)
logcat -s "TAGNAME" 只顯示某個 tag 的 msg
要是只用 logcat,所有 tag 都會輸出。
如果只是想要看某一個 tag 的 message,就要用:
-- 奇怪的是 google 的 logcat 說明 並沒有提到這一項。
如果只是想要看某一個 tag 的 message,就要用:
$logcat -s "TAGNAME"
-- 奇怪的是 google 的 logcat 說明 並沒有提到這一項。
2013年6月17日 星期一
parse-edid : parsing edid 255 byyte 資料的程式
是屬於 read-edid 這個 package,
裝完後,用 parse-edid 讀取 edid 的 255 byte bin file,就會顯示內容,
以 xmbc wiki 裡的 samsung tv example : http://wiki.xbmc.org/index.php?title=Creating_and_using_edid.bin_via_xorg.conf
parse-edid 讀出來的結果是:
裝完後,用 parse-edid 讀取 edid 的 255 byte bin file,就會顯示內容,
以 xmbc wiki 裡的 samsung tv example : http://wiki.xbmc.org/index.php?title=Creating_and_using_edid.bin_via_xorg.conf
parse-edid 讀出來的結果是:
parse-edid: parse-edid version 2.0.0 parse-edid: EDID checksum passed. # EDID version 1 revision 3 Section "Monitor" # Block type: 2:0 3:fd # Block type: 2:0 3:fc Identifier "SAMSUNG" VendorName "SAM" ModelName "SAMSUNG" # Block type: 2:0 3:fd HorizSync 26-76 VertRefresh 23-61 # Max dot clock (video bandwidth) 230 MHz # Block type: 2:0 3:fc # DPMS capabilities: Active off:no Suspend:no Standby:no Mode "1920x1080" # vfreq 60.000Hz, hfreq 67.500kHz DotClock 148.500000 HTimings 1920 2008 2052 2200 VTimings 1080 1084 1089 1125 Flags "+HSync" "+VSync" EndMode Mode "1360x768" # vfreq 60.015Hz, hfreq 47.712kHz DotClock 85.500000 HTimings 1360 1424 1536 1792 VTimings 768 771 777 795 Flags "+HSync" "+VSync" EndMode # Block type: 2:0 3:fd # Block type: 2:0 3:fc EndSection
machine_arch_type 支援多系統的 kernel
作 imx 系列時發現,不管哪一種 cpu (mx51, mx53), board (bbg, smd, loco),竟然都是用同一個 kernel config file。
同一份 kernel image,在不同的 board 上,竟然就會 run 不同的 board init code..
kernel code 是用 machine_arch_type 這個變數 作為 system 的id。
在 include/generated/machine-types.h 有machine id 的定義:
(ref: http://r40eubuntu.blogspot.tw/2013/08/machineisxxx.html)
這個file 後面還有..配合的 function 宣告..
這樣kernel code 就可以用 machi_is_mx53_loco( ) 來決定要不要 run 某段 code..
__machine_arch_type 是在 arch/arm/boot/compressed/misc.c 指定 (填值) 的。
這個 decompress_kernel 是由 kernel boot assembly code 呼叫的..
arch/arm/boot/compressed/head.S
所以知道 machine_id 其實是 bootloader 給的..
u-boot:
結果裡面也有一份 machine-type.h
在 ./board/freescale/mx53_loco/mx53_loco.c
指定給 bi_arch_number, 然後在 bootm command 時..(bootm.c):
剛好是第二個 argument.對應 r1
同一份 kernel image,在不同的 board 上,竟然就會 run 不同的 board init code..
kernel code 是用 machine_arch_type 這個變數 作為 system 的id。
在 include/generated/machine-types.h 有machine id 的定義:
(ref: http://r40eubuntu.blogspot.tw/2013/08/machineisxxx.html)
....
#define MACH_TYPE_AQUARIUS 3009
#define MACH_TYPE_MX53_ARD 3010
#define MACH_TYPE_MX53_SMD 3011
#define MACH_TYPE_LSWXL 3012
#define MACH_TYPE_DOVE_AVNG_V3 3013
#define MACH_TYPE_SDI_ESS_9263 3014
....
#define MACH_TYPE_MX53_LOCO 3273
這個file 後面還有..配合的 function 宣告..
#ifdef CONFIG_MACH_MX53_LOCO
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
# define machine_arch_type MACH_TYPE_MX53_LOCO
# endif
# define machine_is_mx53_loco() (machine_arch_type == MACH_TYPE_MX53_LOCO)
#else
# define machine_is_mx53_loco() (0)
#endif
這樣kernel code 就可以用 machi_is_mx53_loco( ) 來決定要不要 run 某段 code..
__machine_arch_type 是在 arch/arm/boot/compressed/misc.c 指定 (填值) 的。
unsigned long
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
unsigned long free_mem_ptr_end_p,
int arch_id)
{
unsigned char *tmp;
output_data = (unsigned char *)output_start;
free_mem_ptr = free_mem_ptr_p;
free_mem_end_ptr = free_mem_ptr_end_p;
__machine_arch_type = arch_id;
arch_decomp_setup();
tmp = (unsigned char *) (((unsigned long)input_data_end) - 4);
output_ptr = get_unaligned_le32(tmp);
putstr("Uncompressing Linux...");
do_decompress(input_data, input_data_end - input_data,
output_data, error);
putstr(" done, booting the kernel.\n");
return output_ptr;
}
這個 decompress_kernel 是由 kernel boot assembly code 呼叫的..
arch/arm/boot/compressed/head.S
b 1f
.word 0x016f2818 @ Magic numbers to help the loader
.word start @ absolute load/run zImage address
.word _edata @ zImage end address
1: mov r7, r1 @ save architecture ID
.....
.....
mov r5, r2 @ decompress after malloc space
mov r0, r5
mov r3, r7
bl decompress_kernel
所以知道 machine_id 其實是 bootloader 給的..
u-boot:
結果裡面也有一份 machine-type.h
在 ./board/freescale/mx53_loco/mx53_loco.c
int board_init(void)
{
setup_boot_device();
setup_soc_rev();
gd->bd->bi_arch_number = MACH_TYPE_MX53_LOCO; /* board id for linux */
..
指定給 bi_arch_number, 然後在 bootm command 時..(bootm.c):
int machid = bd->bi_arch_number;
...
...
theKernel (0, machid, bd->bi_boot_params);
剛好是第二個 argument.對應 r1
2013年6月14日 星期五
mx53 qsb 的 patch 內容.. (10.2)
device/fsl
新增 imx53_loco .
frameworks/base
修正 stay_on_while_plugged
hardware/mx5x/
libcamera -- 用 'isfound' 決定是不是有 front(?) camera
libgralloc -- boot argument ldb 的parsing
system/core
calibration - use da9053
kernel
defconfig : 使用 da9053 touch, 不用mma8451, osb otg, arc otg.
mx53_loco.c: 新增 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 as gpio, 一堆 video mode, fb_data 改 RGB24, gpo-key, da9052_tsi,
kernel, 10.3.1 的 patch
ripley patch
u-boot
adeneo -- 新增 loco.
10.3.1 -- 修正 da9053 bug
ripley -- 修正 I2C
新增 imx53_loco .
frameworks/base
修正 stay_on_while_plugged
hardware/mx5x/
libcamera -- 用 'isfound' 決定是不是有 front(?) camera
libgralloc -- boot argument ldb 的parsing
system/core
calibration - use da9053
kernel
defconfig : 使用 da9053 touch, 不用mma8451, osb otg, arc otg.
mx53_loco.c: 新增 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 as gpio, 一堆 video mode, fb_data 改 RGB24, gpo-key, da9052_tsi,
kernel, 10.3.1 的 patch
ripley patch
u-boot
adeneo -- 新增 loco.
10.3.1 -- 修正 da9053 bug
ripley -- 修正 I2C
2013年6月13日 星期四
Warning: The following NEW gits exist already in your work tree and will be removed firstly. external/linux-lib external/linux-firmware-imx external/linux-atheros-wifi external/wpa_supplicant_ath system/wlan/atheros hardware/mx5x external/systemtap system/dispd packages/apps/fsl_imx_demo device/fsl Continue? [yes/no]yes Load new gits created by FSL... Creating NEW gits - external/linux-lib Creating NEW gits - external/linux-firmware-imx Creating NEW gits - external/linux-atheros-wifi Creating NEW gits - external/wpa_supplicant_ath Creating NEW gits - system/wlan/atheros Creating NEW gits - hardware/mx5x Creating NEW gits - external/hostapd-0.6.8 Creating NEW gits - external/systemtap Creating NEW gits - system/dispd Creating NEW gits - packages/apps/fsl_imx_demo Creating NEW gits - device/fsl
2013年6月4日 星期二
worklog: linux gpiolib, interface between kernel and user space
不知道幾版的 linux kernel 開始有 gpiolib 的 support。
需要的 kernel configs:
Kernel document gpio.txt 有使用說明。
這個 driver 的名稱叫 gpiolib (driver/gpio/gpiolib.c)
driver 分成 kernel 使用 和 user space 使用。
kernel 使用:
gpio 用數字來代表,所以implement gpio driver 時,要把chip 的 gpio pin 一般化成數字 index。
之後,就是用..
之後 kernel 的使用就可以用 gpio_set_value(-number-,value) 來設定。
User Space 使用:
這是用 sysfs 提供 user space 控制的 interface。
這個 目錄 ls 會是:
echo 0 就是 low。
如果gpio 在 kernel request,但是 kernel 沒有呼叫 export 把該 gpio export 出來,在 /sys/class/gpio 下就不會出現。
同時,user space 要利用 export 把該 gpio export 也不可能 (因為kernel 已經用了)。
所以 kernel, user space 要共同控制 gpio 的話,就要由 kernel 作 gpio_request,同時要呼叫 gpio_export 把 該 gpio export 出來。
ref:
需要的 kernel configs:
CONFIG_ARCH_REQUIRE_GPIOLIB CONFIG_GPIOLIB CONFIG_GPIO_SYSFS這樣的 kernel (加上 chip 有 implement 自己的 gpio driver),就可以使用一般化的 gpio function 控制 gpio。
Kernel document gpio.txt 有使用說明。
這個 driver 的名稱叫 gpiolib (driver/gpio/gpiolib.c)
driver 分成 kernel 使用 和 user space 使用。
kernel 使用:
#define nLCD0_EN (6*32 + 10) /* GPIO_7_10 */
gpio_request(nLCD0_EN, "nLCD0_EN");
gpio_direction_output(nLCD0_EN, 0);
gpio_set_value(nLCD0_EN,0);
gpio_export(nLCD0_EN,0);
gpio 用數字來代表,所以implement gpio driver 時,要把chip 的 gpio pin 一般化成數字 index。
之後,就是用..
- request : 向 driver 要求使用 gpio
- direction : 設定 gpio input or output
- set_value : 設定 gpio high/low
- export : 設定該 gpio 可以 export 到 user space (sysfs) 讓 user space 使用
之後 kernel 的使用就可以用 gpio_set_value(-number-,value) 來設定。
User Space 使用:
這是用 sysfs 提供 user space 控制的 interface。
/sys/class/gpio/
這個 目錄 ls 會是:
export unexport gpiochip0 gpiochip32 gpiochip64 gpiochip96 gpiochip128 gpiochip160 gpiochip192 gpio202 gpio198 gpio201其中:
- export : 把數字寫入這裡,就可以作 request 的動作
- unexport : 和 export 相反,把數字寫進入,就會 unregister 該 gpio
- gpiochipXXX : 有些 gpio 的 控制是 chip(group) 的,就用這個 interface
- gpioXXX : kernel 或 user export 出來的 gpio,每個gpio 會有一個 node (folder)
#echo 1 > gpio202/value
設定 gpio202 為 Highecho 0 就是 low。
如果gpio 在 kernel request,但是 kernel 沒有呼叫 export 把該 gpio export 出來,在 /sys/class/gpio 下就不會出現。
同時,user space 要利用 export 把該 gpio export 也不可能 (因為kernel 已經用了)。
所以 kernel, user space 要共同控制 gpio 的話,就要由 kernel 作 gpio_request,同時要呼叫 gpio_export 把 該 gpio export 出來。
ref:
- http://www.support.emtrion.de/doku.php?id=linux:linux_gpio-emdist-23
- http://brew-j2me.blogspot.tw/2010/03/linux-accessing-gpio-from-user-space.html
- http://armbedded.eu/node/258
- https://developer.ridgerun.com/wiki/index.php/How_to_use_GPIO_signals
- http://www.linux.com/learn/tutorials/765810-beaglebone-black-how-to-get-interrupts-through-linux-gpio
2013年6月3日 星期一
worklog: i2c control ADV7611
要對 ADV7611 控制。
介面是 i2c。
使用 i2ctool,follow 這一篇: http://boundarydevices.com/i2c-tools-under-android/
到舊版頁面 去download 3.0.2
2019: source 改道這裡了...
再follow 那一篇,把 Android.mk create 出來。
為了避免 link 不見, copy 了一份在 gist。
OK, build 出來後,在 android 下就可以 run 了。
先用 i2cdetect -l 看一下:
有出現 3 個 i2c bus 。
ADV7611 datasheet,說明 reset 後,i2c address 是 0x98。
但是 i2c address 是 7 個 bit + 1 個 bit R/W。
參考以前歐先生的 code,知道,在用 linux driver 控制時,要把這種標示的 i2c address shift 1 bit:
就是 0x4c
用 i2cget commadn 讀一下 register 0xEA, 0xEB : Revision identification:
所以是 0x2051. ADV7611 沒錯。
接著測試 write function。
ADV7611 有說,他的 address 是考 VS/FIELD/ALSB 決定的。
但是這是動態決定,所有 chip power on reset 後,address 都是 0x98。
之後 write 0x01 到 register 0x1B (SAMPLE_ALSB),之後, chip 就會依照 VS/FIELD/ALSB 的電壓決定 address:
然後寫入:
用新 address 0x4d 讀讀看:
好像成功了。
很可惜的,這個 tool 是基於 smbus,所以只有符合 smbus 規範的 i2c 裝置才能用。
TI 有一篇 pdf 說明 smbus, i2c 的差異: http://www.ti.com/lit/an/sloa132/sloa132.pdf
介面是 i2c。
使用 i2ctool,follow 這一篇: http://boundarydevices.com/i2c-tools-under-android/
到舊版頁面 去download 3.0.2
2019: source 改道這裡了...
git clone git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git -b i2c-tools-3.1解開到 framework 下,
再follow 那一篇,把 Android.mk create 出來。
為了避免 link 不見, copy 了一份在 gist。
OK, build 出來後,在 android 下就可以 run 了。
先用 i2cdetect -l 看一下:
i2c-0 i2c imx-i2c I2C adapter i2c-1 i2c imx-i2c I2C adapter i2c-2 i2c imx-i2c I2C adapter
有出現 3 個 i2c bus 。
ADV7611 datasheet,說明 reset 後,i2c address 是 0x98。
但是 i2c address 是 7 個 bit + 1 個 bit R/W。
參考以前歐先生的 code,知道,在用 linux driver 控制時,要把這種標示的 i2c address shift 1 bit:
0x98 >> 1
就是 0x4c
用 i2cget commadn 讀一下 register 0xEA, 0xEB : Revision identification:
bash-3.2# i2cget -f -y 0 0x4c 0xea
0x20
bash-3.2# i2cget -f -y 0 0x4c 0xeb
0x51
所以是 0x2051. ADV7611 沒錯。
接著測試 write function。
ADV7611 有說,他的 address 是考 VS/FIELD/ALSB 決定的。
但是這是動態決定,所有 chip power on reset 後,address 都是 0x98。
之後 write 0x01 到 register 0x1B (SAMPLE_ALSB),之後, chip 就會依照 VS/FIELD/ALSB 的電壓決定 address:
- low : 0x98 (shift 後就是 0x4c)
- high: 0x9A (shift 後就是 0x4d)
bash-3.2# i2cget -f -y 0 0x4c 0x1b
0x00
然後寫入:
bash-3.2# i2cset 0 0x4c 0x1b 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-0, chip address 0x4c, data address
0x1b, data 0x01, mode byte.
Continue? [Y/n] Y
用新 address 0x4d 讀讀看:
bash-3.2# i2cget -f -y 0 0x4d 0x1b
0x01
好像成功了。
很可惜的,這個 tool 是基於 smbus,所以只有符合 smbus 規範的 i2c 裝置才能用。
TI 有一篇 pdf 說明 smbus, i2c 的差異: http://www.ti.com/lit/an/sloa132/sloa132.pdf
標籤
- 3g (19)
- 工作的備worklog (93)
- 自言自語 (36)
- 草稿 (1)
- 亂亂寫 (8)
- 翻譯 (3)
- administration (76)
- alsa (7)
- android (299)
- apple (5)
- application (42)
- archlinux (1)
- audio (3)
- avr (6)
- backup_restore (2)
- bluetooth (5)
- bookmark (38)
- bootloader (21)
- browser (5)
- cellphone (28)
- command (8)
- Configuration (27)
- debug (7)
- django (1)
- driver (15)
- earphone (1)
- editor (1)
- EFL (1)
- ffmpeg (18)
- Filesystem (4)
- GCC (8)
- Gentoo (1)
- google (1)
- Graphic (3)
- hardware (40)
- hero (7)
- hibernation (9)
- iMX51 (38)
- Info (3)
- Install (30)
- java (4)
- Kernel (102)
- language (2)
- life (2)
- make (11)
- MantainLog (38)
- MCU_P (9)
- memo (8)
- microcontroller (3)
- MINGW (7)
- network (19)
- OpenCL (1)
- OS (11)
- package (3)
- pad (1)
- ProblemAndSolve (15)
- programming (8)
- Python (7)
- raspberry_pi (23)
- SDL (2)
- sensation (13)
- setup (3)
- software_package (36)
- SQL (1)
- suspend (2)
- ToDo (5)
- tool (3)
- ubuntu (1)
- VersionControl (45)
- Virtualization (15)
- VLC (5)
- wheezy (1)
- wifi (3)
- Windows (16)
- xiaomi (1)
- xperia (1)
網誌存檔
-
▼
2013
(116)
-
▼
6月
(12)
- Sensation 開始,,
- arm-eabi-readelf 列出用到的 so (android 的 ldd)
- 新版 uboot 的 fastboot command emmc function config 改了..
- Display port and interface
- Display: MEM_BG_SYNC : 2-layer-fb-bg MEM_FG_SYNC ...
- logcat -s "TAGNAME" 只顯示某個 tag 的 msg
- parse-edid : parsing edid 255 byyte 資料的程式
- machine_arch_type 支援多系統的 kernel
- mx53 qsb 的 patch 內容.. (10.2)
- Warning: The following NEW gits exist already in y...
- worklog: linux gpiolib, interface between kernel a...
- worklog: i2c control ADV7611
-
▼
6月
(12)