ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2013年4月30日 星期二

rw.SECOND_DISPLAY_CONNECTED 對應 dev->wec_disp_connected
rw.secfb.disable-overlay 對應 to_disable_overlay
然後 if(dev->sec_disp_connected&&dev->to_disable_overlay){ if(!dev->to_tvout_display){ property_set("sys.VIDEO_TVOUT_DISPLAY", "1"); dev->to_tvout_display = 1; LOGI("enable VIDEO TVOUT MODE"); } } 也就是說:
SECOND_DISPLAY_CONNECTED 要是 1
secfb.disable-overlay 要是 1
才會 enable VIDEO_TVOUT_DISPLAY

2013年4月23日 星期二

在 uboot 加上 mc13892 的 read write cmd

diff --git a/common/Makefile b/common/Makefile
index ad7cb4f..8eee015 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -168,6 +168,8 @@ COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+COBJS-y += cmd_pmic.o
+
COBJS := $(sort $(COBJS-y))
SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/include/configs/mx51_bbg_android.h b/include/configs/mx51_bbg_android.h
index 576fe89..095db74 100644
--- a/include/configs/mx51_bbg_android.h
+++ b/include/configs/mx51_bbg_android.h
@@ -83,6 +83,49 @@
#define CONFIG_NET_RETRY_COUNT 100
#define CONFIG_CMD_I2C
+#define CONFIG_CMD_CLOCK
+#define CONFIG_REF_CLK_FREQ CONFIG_MX51_HCLK_FREQ
+
+/*
+ * FUSE Configs
+ * */
+#ifdef CONFIG_CMD_IIM
+ #define CONFIG_IMX_IIM
+ #define IMX_IIM_BASE IIM_BASE_ADDR
+ #define CONFIG_IIM_MAC_BANK 1
+ #define CONFIG_IIM_MAC_ROW 9
+#endif
+
+/*
+ * SPI Configs
+ * */
+#ifdef CONFIG_CMD_SF
+ #define CONFIG_FSL_SF 1
+ #define CONFIG_SPI_FLASH_IMX_ATMEL 1
+ #define CONFIG_SPI_FLASH_CS 1
+ #define CONFIG_IMX_ECSPI
+ #define IMX_CSPI_VER_2_3 1
+ #define CONFIG_IMX_SPI_PMIC
+ #define CONFIG_IMX_SPI_PMIC_CS 0
+
+ #define MAX_SPI_BYTES (64 * 4)
+#endif
+
+/*
+ * MMC Configs
+ * */
+#ifdef CONFIG_CMD_MMC
+ #define CONFIG_MMC 1
+ #define CONFIG_GENERIC_MMC
+ #define CONFIG_IMX_MMC
+ #define CONFIG_SYS_FSL_ESDHC_NUM 2
+ #define CONFIG_SYS_FSL_ESDHC_ADDR 0
+ #define CONFIG_SYS_MMC_ENV_DEV 0
+ #define CONFIG_DOS_PARTITION 1
+ #define CONFIG_CMD_FAT 1
+ #define CONFIG_DYNAMIC_MMC_DEVNO
+#endif
+
#include <linux/types.h>
#include <command.h>
#include <common.h>
#include <imx_spi.h>
#include <asm/arch/imx_spi_pmic.h>
int do_pmicops(cmd_tbl_t *cmdtp,int flag,int argc,char *argv[])
{
int rc=0;
u32 reg;
u32 val;
struct spi_slave *slave;
slave = spi_pmic_probe();
switch(argc) {
case 1:
printf("nothing\n");
break;
case 2:
reg = simple_strtoul(argv[1],NULL,10);
val = pmic_reg(slave,reg,0,0);
printf("reg%d = %X\n",reg,val);
break;
case 3:
reg = simple_strtoul(argv[1],NULL,10);
val = simple_strtoul(argv[2],NULL,16);
pmic_reg(slave,reg,val,1);
printf("write reg%d = %X\n",reg,val);
break;
default:
rc=1;
printf("Too much parameters.\n");
break;
}
spi_pmic_free(slave);
return rc;
}
U_BOOT_CMD(pmic,3,1,do_pmicops,
"PMIC sub system",
"Read/Write pmic\n"
"pmic regno : read regno\n"
"pmic regno value(0x..) : write value to regno");
view raw gistfile1.c hosted with ❤ by GitHub

2013年4月16日 星期二

mmc 4.4, boot partition --- disable emmc boot partiton function in kernel & uboot

遇到的問題是:

fail 的機器,開機後,寫入 bootloader (1k~1M 區域),好像沒效。
dd 完 dump 出來看是 OK。
但是重新開機後就恢復沒 dd 的狀態。

如果使用 fastboot flash bootloader,write 完畢會出現:
Warning: fail to get ext csd for MMC!
Error: Fail to switch partition to 1
Writing 'bootloader' FAILED!
然後就掛了。

使用另一個 sd slot 開機後燒錄 eMMC 才會 OK。

以下是 cat /sys/devices/platform/mxsdhc.2/mmc_host/mmc0\:001/boot_info 的內容:

fail 的機器:
boot_info:0x07;
  ALT_BOOT_MODE:1 - Supports alternate boot method
  DDR_BOOT_MODE:1 - Supports alternate dual data rate during boot
  HS_BOOTMODE:1 - Supports high speed timing during boot
boot_size:2048KB
boot_partition:0x48;
  BOOT_ACK:1 - Boot acknowledge sent during boot operation
  BOOT_PARTITION-ENABLE: 1 - Boot partition 1 enabled
  PARTITION_ACCESS:0 - No access to boot partition
boot_bus:0x12
  BOOT_MODE:2 - Use dual data rate in boot operation
  RESET_BOOT_BUS_WIDTH:0 - Reset bus width to x1, single data rate and backwardcompatible timings after boot operation
  BOOT_BUS_WIDTH:2 - x8 (sdr/ddr) bus width in boot operation mode


OK 的機器:
boot_info:0x07;
  ALT_BOOT_MODE:1 - Supports alternate boot method
  DDR_BOOT_MODE:1 - Supports alternate dual data rate during boot
  HS_BOOTMODE:1 - Supports high speed timing during boot
boot_size:2048KB
boot_partition:0x00;
  BOOT_ACK:0 - No boot acknowledge sent
  BOOT_PARTITION-ENABLE: 0 - Device not boot enabled
  PARTITION_ACCESS:0 - No access to boot partition
boot_bus:0x00
  BOOT_MODE:0 - Use single data rate + backward compatible timings in boot operation
  RESET_BOOT_BUS_WIDTH:0 - Reset bus width to x1, single data rate and backwardcompatible timings after boot operation
  BOOT_BUS_WIDTH:0 - x1 (sdr) or x4 (ddr) bus width in boot operation mode



所以 fail 的機器好像 boot partition 被 enable 了 -- 因為 BOOT_ACK 被trigger。
這個在 imx53 上是 boot mode pin,由 gpio 決定的。

所以使用 eMMC 開機時,mmc host 依照 boot mode送出了 boot_ack,
所以 eMMC 的 boot partition 被 enable 了,並且是 write protected。

使用另一格 sd 開機, emmc 得 host 由 software config,所以沒有 enable boot_ack,所以沒有 write protected。

OK 的機器, boot ack pin 是正確的,所以 boot partition 是 disable。

實際上 boot partition 的功能可以用 MMC command 來改變,
就是利用 ext_csd 來改變 boot parition 的功能/狀態。

這一篇 Re: Patch: eMMC boot partition needs to be deactivated for linux to find user partitions 就是作這樣的事:
在 linux kernel mmc driver 啟動時,把 boot partition 功能關閉。

在 driver/mmc/core/mmc.c 的 mmc_init_card( ) 加上: diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index db54b2d..709be9f 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -826,6 +826,20 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, } } + /* ensure eMMC private booting PARTITION is not enabled + */ + if (card->ext_csd.boot_config != 0) { + printk(KERN_WARNING "%s: disable boot partition\n", + mmc_hostname(card->host)); + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, + EXT_CSD_BOOT_CONFIG,0x0); + if (err) { + printk(KERN_WARNING "%s: disable boot partition failed\n", + mmc_hostname(card->host)); + err=0; + } + } + /* * Compute bus speed. */ 這樣 kernel 起來後,eMMC 就都一定可以 write 了。
只剩下 uboot,,, fastboot 一樣無法燒錄 bootloader 和 kernel...

看 uboot code,是在 write 完後,switch partition 時, failed。
但是不使用 boot partition 時,根本就沒有 partition。
所以直接把 uboot 的 diff --git a/include/configs/mx53_smd_android.h b/include/configs/mx53_smd_android.h index 553a920..28c214a 100755 --- a/include/configs/mx53_smd_android.h +++ b/include/configs/mx53_smd_android.h @@ -263,7 +263,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_MODE #define CONFIG_EMMC_DDR_PORT_DETECT /* port 1 (ESDHC3) is 8 bit */

2013年4月11日 星期四

Music 開啟失敗..NotFoundException: Resource ID #0x7f030009

一直都可以用的 Music 這個標準 apk,在新 板子上竟然出現 exception, 然後啟動 fail..
 android.content.res.Resources$NotFoundException: Resource ID #0x7f030009
E/AndroidRuntime( 2462):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
E/AndroidRuntime( 2462):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime( 2462):        at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 2462):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime( 2462):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2462):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 2462):        at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 2462):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2462):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 2462):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 2462):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 2462):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2462): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030009
E/AndroidRuntime( 2462):        at android.content.res.Resources.getValue(Resources.java:892)
E/AndroidRuntime( 2462):        at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)
E/AndroidRuntime( 2462):        at android.content.res.Resources.getLayout(Resources.java:731)
E/AndroidRuntime( 2462):        at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
E/AndroidRuntime( 2462):        at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
E/AndroidRuntime( 2462):        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
E/AndroidRuntime( 2462):        at android.app.Activity.setContentView(Activity.java:1657)
E/AndroidRuntime( 2462):        at com.android.music.ArtistAlbumBrowserActivity.onCreate(ArtistAlbumBrowserActivity.java:106)
E/AndroidRuntime( 2462):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2462):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
E/AndroidRuntime( 2462):        ... 11 more
W/ActivityManager( 2204):   Force finishing activity com.android.music/.ArtistAlbumBrowserActivity
google 一下竟然有解:
https://bugs.launchpad.net/linaro-android/+bug/772528

他說這是因為 Music 要找 touch device ,找不到...
-- 沒錯,這格板子真的沒有 touch...

解法也是那個 thread 中..
方法是作一個假的 touch device...
當然也有人說,就在 kernel 指定選一個 touch driver

imx53 的 uart 開啟 dma 也有問題 --- 但是有 patch, 還有一些相關threads..

https://community.freescale.com/thread/304428

另外有關 TV Out 的參數設定和說明: https://community.freescale.com/thread/301648

Sorry, I misread the question. I thought you are using ADV7180.
for your case, I think it may be the problem of bootarg.
According to the BSP release note, there is an example for TVE output.
"video=mxcdi1fb:YUV444,TV-1080P30 di1_primary tve"
NOTE: GBR24/RGB565/YUV444 etc represent the display HW interface format, typical value for different display devices is like below:
TVOUT: YUV444
VGA: GBR24
HDMI&DVI: RGB24
CLAA WVGA LCD: RGB565

after enable tve, below video modes will be added into di1 FB mode list:
TV-1080P24: D:1920x1080p-24
TV-1080P25: D:1920x1080p-25
TV-1080P30: D:1920x1080p-30
TV-1080I50: D:1920x1080i-50
TV-1080I60: D:1920x1080i-60
TV-720P30: D:1280x720p-30
TV-720P60: D:1280x720p-60
TV-PAL: D:720x576i-50
TV-NTSC: D:720x480i-60


so for your case, please try: 
"video=mxcdi1fb:YUV444,TV-PAL di1_primary tve"

freescale 為已經 phase out(?) 在mantain 狀態的 chip 設立一個 kernel 的 maintain branch:
Submit i.MX53 & i.MX28 Linux kernel patches

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/

標籤

網誌存檔