高通的開發板上,大多會把NOR、NAND 類型的閃存都執行初始化,eMMC也是預設啟動的。而在實際開發產品的時候,常常只使用到其中1、2樣,很少會都用上的。這些多出來的裝置,在Uboot中多少會影響到開機的時間,以及多餘的耗電,更甚者會因為GPIO的function不對,讓系統異常。
那我們該如何在Uboot中把一些沒用到的裝置給移除或者關閉呢?
閃存:
默認情況下,所有的閃存類型都會在Uboot中被初始化。例如: 如果只有NOR類型的閃存被使用,則可以將NAND和eMMC的閃存類型禁用。禁用閃存的方式如下表:
|
Flash type |
To disable the flash type if it is not needed |
|
NOR |
Remove these lines in qsdk/qca/src/u-boot-2016/include/configs/ipq9574.h: |
|
#define CONFIG_QCA_SP |
|
|
#define CONFIG_SPI_FLASH |
|
|
#define CONFIG_CMD_SF |
|
|
#define CONFIG_SPI_FLASH_STMICRO |
|
|
#define CONFIG_SPI_FLASH_WINBOND |
|
|
#define CONFIG_SPI_FLASH_MACRONIX |
|
|
#define CONFIG_SPI_FLASH_GIGADEVICE |
|
|
#define CONFIG_SPI_FLASH_SPANSIO |
|
|
#define CONFIG_SF_DEFAULT_BUS 0 |
|
|
#define CONFIG_SF_DEFAULT_CS 0 |
|
|
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
|
|
#define CONFIG_SF_DEFAULT_SPEED (48 * 1000 * 1000) |
|
|
#define CONFIG_SPI_FLASH_BAR 1 |
|
|
#define CONFIG_SPI_FLASH_USE_4K_SECTORS |
|
|
#define CONFIG_ENV_IS_IN_SPI_FLASH 1 |
|
|
|
|
|
NAND |
Remove the NAND node from the qsdk/qca/src/u-boot-2016/arch/arm/dts/ipq9574- soc.dtsi file by removing these lines of code: |
|
nand: nand-controller@79B0000 { #address-cells = ; #size-cells = ; compatible = "qcom,qpic-nand-v2.1.1"; reg = ; status = "disabled"; }; |
|
|
eMMC |
Remove this line in qsdk/qca/src/u-boot-2016/include/configs/ipq9574.h: |
|
#define CONFIG_QCA_MMC |
周邊:
預設這些周邊控制項是致能的。禁用方式如下:
|
Peripheral |
To disable the peripheral if it is not needed: |
|
USB |
Remove these lines in qsdk/qca/src/u-boot-2016/configs/ipq9574_defconfig: |
|
CONFIG_USB=y |
|
|
CONFIG_DM_USB=y |
|
|
Remove this line in include/configs/ipq9574.h: |
|
|
#define CONFIG_USB_XHCI_IPQ |
|
|
PCIe |
Remove this line in qsdk/qca/src/u-boot-2016/include/configs/ipq9574.h: |
|
#define PCI_MAX_DEVICES 4 |
|
|
Remove this line in qsdk/qca/src/u-boot-2016/configs/ipq9574_defconfig |
|
|
CONFIG_PCI_IPQ=y |
|
|
I2C |
Remove this line in qsdk/qca/src/u-boot-2016/include/configs/ipq9574.h: |
|
#define CONFIG_IPQ9574_I2C 1 |
適時的禁用沒有使用的閃存以及周邊控制項,可以有效的提升系統的穩定以及能耗。不僅對系統的掌控度更精準,也可以避免誤動作造成器件的干擾。
想了解更多,請關注大大通。