Reprint to: http://blog.csdn.net/bmw7bmw7/article/details/46126223 Spreadtrum 7731 Platform Driver Debug Summary-Drive configuration section
1. Key configuration file path
1). Project board level configuration: Files within the idh.code/device/sprd/scx35_sp7731geaplus_pad_qhd/folder
⑴.BOARDCONFIG.MK---Board-level macro configuration file. Includes setting the UBOOT/KERENL global configuration macro file used by the Board (project), camera interface type, resolution and other parameters, the use of the gravitational acceleration, light sensor, internal storage space size distribution.
⑵. init.board.rc---Board-level custom boot service files (TP, sensor, etc. start-up instructions for devices are placed in this file)
⑶.System.prop---Board-level System Properties file (when the LCD used is a screen rotated 90° or 180° display, configure the ro.sf.hwrotation value so that the output image on the system side is correct.) Please try not to change the LCD IC register to reverse the direction of the image display, because it is very easy to get the problem of cutting screen.
⑷.XXX.IDC---TP touch screen properties file. When a new touch driver, you need to add the corresponding file name of the IDC file, otherwise there will be a small circle in the interface after entering the system, the problem of the touch function is abnormal.
2). Kernel module: kernel/arch/arm/configs/sp7731geaplus_pad_qhd-dt_defconfig(the file is kernel_ in Boardconfig.mk Defconfig OK)
3). Uboot module: idh.code/u-boot/include/configs/sp7731geaplus_pad_qhd.h(the file is uboot_ in Boardconfig.mk Defconfig OK)
Note: Different projects use different profiles, and users can create different project engineering files to support different projects in a set of code.
2. Flash configuration (including the memory RAM size of the configuration item, the internal storage space size)
The RAM configuration is as follows:
1). Chipram module: idh.code\chipram\include\configs\sp7731geaplus_pad_qhd.h
ddr_type Definition of the DDR chip information used
2). Uboot module: idh.code\u-boot\include\configs\sp7731geaplus_pad_qhd.h
Defines the amount of memory ram used by the project config_ram512m/config_ram1g/config_ram256m
3). Kernel module: Idh.code/kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts
Memory {
Device_type = "Memory";
reg = <0x80000000 0x20000000>;
};
The 0x20000000 is 512M.
The ROM configuration is as follows: Idh.code/device/sprd/scx35_sp7731geaplus_pad_qhd/boardconfig.mk
board_systemimage_partition_size: The amount of space allocated to the system.img file
board_userdataimage_partition_size: The size of the internal storage allocated to the phone (tablet)
3. LCD
1). Kernel module: LCD new screen in Kernel\arch\arm\configs\ sp7731geaplus_pad_qhd-dt_defconfig
Add this item under the KERNEL/DRIVERS/VIDEO/SPRDFB/LCD directory LCD driver
Modify the system LCD backlight configuration under the Kernel/drivers/video/backlight directory (if not the same as the system default configuration);
2). Uboot module: U-boot\include\configs\ sp7731geaplus_pad_qhd.h defines the new LCD screen and its resolution
Add this item under the U-BOOT/DRIVERS/VIDEO/SPRDFB/LCD directory LCD driver
U-boot/drivers/video/sprdfb/sprdfb_panel.c added the function structure and ID of the new LCD;
U-boot/drivers/video/sprdfb/sprdfb_mainc Modify the backlight configuration of the new project (if not the same as the system default configuration);
2. CTP Touch screen
(1) Kernel\arch\arm\configs\ sp7731geaplus_pad_qhd-dt_defconfig in the configuration of new TP
(2) Adding TP drive in Kernel/drivers/input/touchscreen;
Note: CTP drivers on Android 4.03, such as Spreadtrum 8825C, can be used directly on Android 4.4 without modification or simple modification.
(3) Add the corresponding XXX.IDC file Device/sprd/scx35_sp7731geaplus_pad_qhd/inside, and in Scx35_sp7731geaplus_pad_qhd_ The XXX.IDC file is called in the Dt.mk file (if you do not add or add an error, it may cause a small, mouse-like circle to appear on the system interface after booting).
(4) The starting instruction of adding new TP in device/sprd/scx35_sp7731geaplus_pad_qhd/init.board.rc.
(5) Idh.code/kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts configuration of the new TP device name and its i²c address, reset and interrupt pin number parameters.
Note: In the driver, we need to add special analytic functions to parse the contents of the device tree Sprd-scx35_sp7731geaplus_pad_qhd.dts.
Supplement: Starting with the 7731 platform, Spreadtrum uses the device tree to configure the device. A device tree is a data structure used to describe device hardware parameters.
3. Camera
(1) According to camera Module factory proofing camera placement direction, configure the Device\sprd\scx35\boardconfigcommon.mk file in the front/rear camera direction.
If the camera in the module factory proofing direction is horizontal screen, then target_board_back_camera_rotation and target_board_front_camera_rotation set to False, otherwise set to true.
(2) The resolution of the Camera_support_size configuration camera in the Idh.code/device/sprd/scx35_sp7731geaplus_pad_qhd/boardconfig.mk file (can be larger than the actual value, interpolated), Camera Communication Interface, etc.
(3) According to the circuit schematic diagram, in the Kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts file Sprd_sensor place the front and rear camera pwdn, reset foot.
(4) Add specific camera driver inside the vendor/sprd/open-source/libs/libcamera/sensor.
(5) Front and rear camera set in VENDOR/SPRD/OPEN-SOURCE/LIBS/LIBCAMERA/SC8830/SRC/SENSOR_CFG.C
When debugging a camera, pay particular attention to the output voltage size differences between the three Ldo Vddcama (2.8V), Vddcamio (1.8V), Vddcammot (3.0V). Customer's module factory in proofing often ignore the Vddcama, Vddcamio the two Ldo supply voltage output difference, resulting in camera point not lit. Therefore, when debugging, if the camera point is not lit, you can try jumper short Vddcama (2.8V), Vddcamio (1.8V), to confirm whether this is the problem.
If there is a front and rear camera in the project, if the point is not lit during commissioning, you can also try to swap the pwdn of the front and rear camera settings feet. In the actual debugging also often appear the module factory will this even a pin swap problem.
4 sensor
(1) Add new sensor global configuration in Kernel\arch\arm\configs\ sp7731geaplus_pad_qhd-dt_defconfig
(2) kernel layer: kernel/drivers/input/misc/sensor is added to the underlying driver
(3) HAL layer: vendor/sprd/open-source/libs/libsensors/adding HAL Layer code
(4) sensor sensors used in the Device/sprd/scx35_sp7731geaplus_pad_qhd/boardconfig.mk file (for HAL Layer compilation control)
(5) Start-up instructions for adding new sensor in device/sprd/scx15_sp7715ga/init.board.rc.
(6) Configure a new sensor device name and its i²c address in Kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts, interrupt the GPIO port configuration.
Note: In the driver, we need to add special analytic functions to parse the contents of the device tree Sprd-scx35_sp7731geaplus_pad_qhd.dts.
5. Other configurations
1). Gpio PIN Configuration: u-boot\board\spreadtrum\sp7731geaplus_pad_qhd\pinmap-sp8830.c
2). Keypad key configuration: [email protected]in Kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts.
Spreadtrum 7731 Platform Driver Debugging summary-Drive configuration section