tzh
2024-07-23 7e1950eb53ce0b05e5a39b8aef15428691a2a417
feat(patch): add ido patch
7 files modified
94 ■■■■ changed files
build.sh 11 ●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/config/compiler.mk 4 ●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/kbuild/kbuild.mk 6 ●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/sunxi_android/Makefile 8 ●●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/platform.h 1 ●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/sunxi_platform.c 58 ●●●●● patch | view | raw | blame | history
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/sysconfig.c 6 ●●●● patch | view | raw | blame | history
build.sh
....@@ -11,11 +11,11 @@
1111 ./build.sh
1212 cd -
1313
14
- cd android
15
- . ./build/envsetup.sh
16
- lunch ceres_c3-userdebug
17
- extract-bsp && pack
18
- cd -
14
+ #cd android
15
+ #. ./build/envsetup.sh
16
+ #lunch ceres_c3-userdebug
17
+ #extract-bsp && pack
18
+ #cd -
1919 fi
2020
2121 if [ x"$1" == "xa" ] ;then
....@@ -23,6 +23,7 @@
2323 . ./build/envsetup.sh
2424 lunch ceres_c3-userdebug
2525 extract-bsp
26
+ make installclean
2627 make BUILD_NUMBER=ido-a133 -j10 && pack
2728 # make -j10 && pack -v
2829 cd -
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/config/compiler.mk
....@@ -180,7 +180,7 @@
180180 _kernel_cross_compile := $(if $(filter undef,$(KERNEL_CROSS_COMPILE)),,$(KERNEL_CROSS_COMPILE))
181181 # We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to
182182 # respect CC and we don't support clang in that part currently.
183
- _kernel_cross_compile := $(_kernel_cross_compile)
183
+ _kernel_cross_compile := $(_kernel_cross_compile)gcc
184184 # Then check the compiler.
185185 $(eval $(call calculate-compiler-preferred-target,target,$(_kernel_cross_compile)))
186186 $(eval $(call include-compiler-file,$(target_compiler_preferred_target)))
....@@ -239,7 +239,7 @@
239239 $(warning $(space)$(space)KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE))
240240 $(warning $(space)$(space)$(space)builds for $(_kernel_primary_arch))
241241 $(warning ********************************************************)
242
- $(warning Mismatching kernel and user-mode cross compilers)
242
+ $(error Mismatching kernel and user-mode cross compilers)
243243 endif
244244 endif
245245
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/kbuild/kbuild.mk
....@@ -68,10 +68,10 @@
6868 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
6969 BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \
7070 TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
71
- CLANG_TRIPLE="$(CLANG_TRIPLE)" \
72
- CROSS_COMPILE="$(CROSS_COMPILE)" \
71
+ CLANG_TRIPLE=$(patsubst %-android,%-gnu,$(CROSS_TRIPLE))- \
72
+ CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
7373 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
74
- CC=$(if $(KERNEL_CC),$(KERNEL_CC),$(KERNEL_CROSS_COMPILE)) \
74
+ CC=$(if $(KERNEL_CC),$(KERNEL_CC),$(KERNEL_CROSS_COMPILE)gcc) \
7575 CHECK="$(patsubst @%,%,$(CHECK))" $(if $(CHECK),C=1,) \
7676 V=$(V) W=$(W) TOP=$(TOP)
7777 @for kernel_module in $(addprefix $(TARGET_PRIMARY_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/build/linux/sunxi_android/Makefile
....@@ -41,7 +41,7 @@
4141 export MULTIARCH=64only
4242 export EXCLUDED_APIS=opencl opengl vulkan cldnn imgdnn
4343 export USE_CLANG:=0
44
-#export V := 1
44
+
4545 # If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
4646 # derive the TARGET_DEVICE from TARGET_PRODUCT.
4747 #
....@@ -68,10 +68,8 @@
6868
6969 include ../common/android/arch.mk
7070 include ../common/android/features.mk
71
-ifneq ($(origin CC),undefined)
72
-KERNEL_CC :=$(CC)
73
-endif
74
-$(info $(KERNEL_CC) == $(CC))
71
+
72
+KERNEL_CROSS_COMPILE := $(CROSS_COMPILE)
7573 PVR_ANDROID_COMPOSERHAL := null
7674
7775 PDUMP_STREAMBUF_SIZE_MB := 10
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/platform.h
....@@ -63,7 +63,6 @@
6363 PVRSRV_DEVICE_CONFIG *config;
6464 };
6565
66
-bool sunxi_ic_version_ctrl(struct device *dev);
6766 int sunxi_platform_init(struct device *dev);
6867 void sunxi_platform_term(void);
6968 void sunxiSetFrequencyDVFS(IMG_UINT32 *ui32Frequency);
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/sunxi_platform.c
....@@ -590,50 +590,6 @@
590590 }
591591 #endif /* CONFIG_DEBUG_FS */
592592
593
-static inline int sunxi_get_ic_version(struct device *dev, char *version)
594
-{
595
-#define SYS_CFG_BASE 0x03000000
596
-#define VER_REG_OFFS 0x00000024
597
- void __iomem *io = NULL;
598
- static char ver = 0xff;
599
- /* IC version:
600
- * A/B/C: 0
601
- * D: 3
602
- * E: 4
603
- * F: 5
604
- * 6/7/1/2 to be used in future.
605
- */
606
- *version = 0;
607
- if (ver == 0xff) {
608
- io = ioremap(SYS_CFG_BASE, 0x100);
609
- if (io == NULL) {
610
- dev_err(dev, "ioremap of sys_cfg register failed!\n");
611
- return -1;
612
- }
613
- *version = (char)(readl(io + VER_REG_OFFS) & 0x7);
614
- iounmap(io);
615
- ver = *version;
616
- } else {
617
- *version = ver;
618
- }
619
- return 0;
620
-}
621
-
622
-bool sunxi_ic_version_ctrl(struct device *dev)
623
-{
624
- char ic_version = 0;
625
- sunxi_get_ic_version(dev, &ic_version);
626
- /*
627
- * The flow of jtag reset before gpu reset will cause MIPS crash, so we
628
- * will put the domainA, domainB and gpu reset operations to boot0 stage.
629
- * And in kernel stage, we will always keep domainA poweron.
630
- */
631
- if (ic_version == 0 || ic_version == 3 || ic_version == 4 || ic_version == 5)
632
- return false;
633
- return true;
634
-}
635
-
636
-
637593 int sunxi_platform_init(struct device *dev)
638594 {
639595 #if defined(CONFIG_OF)
....@@ -641,7 +597,7 @@
641597 struct platform_device *pdev = to_platform_device(dev);
642598 #endif /* defined(CONFIG_OF) */
643599 unsigned int val, volt_val = 0;
644
- char ic_version = 0;
600
+
645601 sunxi_data = (struct sunxi_platform *)kzalloc(sizeof(struct sunxi_platform), GFP_KERNEL);
646602 if (!sunxi_data) {
647603 dev_err(dev, "failed to get kzalloc sunxi_platform");
....@@ -678,20 +634,11 @@
678634 sunxi_data->power_idle = 1;
679635 sunxi_data->dvfs = 1;
680636 sunxi_data->independent_power = 0;
681
- sunxi_data->soft_mode = 0;
637
+ sunxi_data->soft_mode = 1;
682638
683639 parse_dts(dev, sunxi_data);
684640 if (!sunxi_data->independent_power)
685641 sunxi_data->dvfs = 0;
686
- sunxi_get_ic_version(dev, &ic_version);
687
- dev_info(dev, "IC version: 0x%08x \n", ic_version);
688
-
689
- if (!sunxi_ic_version_ctrl(dev)) {
690
- sunxi_data->power_idle = 0;
691
- sunxi_data->soft_mode = 1;
692
- } else {
693
- sunxi_data->soft_mode = 0;
694
- }
695642
696643 sunxi_decide_pll(sunxi_data);
697644 spin_lock_init(&sunxi_data->lock);
....@@ -720,7 +667,6 @@
720667 sunxi_data->power_idle = 0;
721668 regulator_set_voltage(sunxi_data->regula, 900000, 900000);
722669 #endif
723
-
724670 init_waitqueue_head(&dvfs_wq);
725671
726672 dev_info(dev, "idle:%d dvfs:%d power:%d %s mode:%d volt:%u core:%lu\n",
longan/kernel/linux-4.9/modules/gpu/img-rgx/android/rogue_km/services/system/rgx_sunxi/sysconfig.c
....@@ -144,11 +144,7 @@
144144 * Setup RGX specific timing data
145145 */
146146 gsRGXTimingInfo.ui32CoreClockSpeed = clk_get_rate(sunxi_data->clks.core);
147
- if (sunxi_ic_version_ctrl(dev)) {
148
- gsRGXTimingInfo.bEnableActivePM = IMG_TRUE;
149
- } else {
150
- gsRGXTimingInfo.bEnableActivePM = IMG_FALSE;
151
- }
147
+ gsRGXTimingInfo.bEnableActivePM = IMG_FALSE;
152148 gsRGXTimingInfo.bEnableRDPowIsland = IMG_TRUE;
153149 gsRGXTimingInfo.ui32ActivePMLatencyms = SYS_RGX_ACTIVE_POWER_LATENCY_MS;
154150