diff options
author | Ondrej Čerman | 2019-09-29 11:43:26 +0200 |
---|---|---|
committer | Ondrej Čerman | 2019-09-29 11:43:26 +0200 |
commit | eb45c2d2a118bd7d8ba7390202a4f8d4761da42e (patch) | |
tree | 0b2de9031f56214cfa9dbcc5e4f1bd805dd26365 | |
parent | 966ae5b1b504b683328be469f4d13800923857c9 (diff) |
Added option to swap CORE and SOC
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | dkms.conf | 4 | ||||
-rw-r--r-- | zenpower.c | 9 |
3 files changed, 21 insertions, 11 deletions
@@ -1,5 +1,6 @@ -TARGET := $(shell uname -r) -DKMS_ROOT_PATH := /usr/src/zenpower-0.1.2 +VERSION := 0.1.3 +TARGET := $(shell uname -r) +DKMS_ROOT_PATH := /usr/src/zenpower-0.1.3 ifneq ("","$(wildcard /usr/src/linux-headers-$(TARGET)/*)") # Ubuntu @@ -16,7 +17,7 @@ endif obj-m := $(patsubst %,%.o,zenpower) obj-ko := $(patsubst %,%.ko,zenpower) -.PHONY: all modules clean dkms-install dkms-uninstall +.PHONY: all modules clean dkms-install dkms-install-swapped dkms-uninstall all: modules @@ -31,10 +32,14 @@ dkms-install: cp $(CURDIR)/dkms.conf $(DKMS_ROOT_PATH) cp $(CURDIR)/Makefile $(DKMS_ROOT_PATH) cp $(CURDIR)/zenpower.c $(DKMS_ROOT_PATH) - dkms add zenpower/0.1.2 - dkms build zenpower/0.1.2 - dkms install zenpower/0.1.2 + + sed -e "s/@CFLGS@/${MCFLAGS}/" \ + -i $(DKMS_ROOT_PATH)/dkms.conf + + dkms add zenpower/$(VERSION) + dkms build zenpower/$(VERSION) + dkms install zenpower/$(VERSION) dkms-uninstall: - dkms remove zenpower/0.1.2 --all + dkms remove zenpower/$(VERSION) --all rm -rf $(DKMS_ROOT_PATH) @@ -1,7 +1,7 @@ -MAKE="make TARGET=${kernelver}" +MAKE="make TARGET=${kernelver} CFLAGS_MODULE+=@CFLGS@" CLEAN="make clean" PACKAGE_NAME="zenpower" -PACKAGE_VERSION="0.1.2" +PACKAGE_VERSION="0.1.3" BUILT_MODULE_NAME[0]="zenpower" DEST_MODULE_LOCATION[0]="/kernel/drivers/hwmon/zenpower" AUTOINSTALL="yes" @@ -318,8 +318,13 @@ static int zenpower_probe(struct pci_dev *pdev, const struct pci_device_id *id) data->pdev = pdev; data->read_amdsmn_addr = read_amdsmn_addr; - data->svi_core_addr = F17H_M01H_SVI_TEL_PLANE0; - data->svi_soc_addr = F17H_M01H_SVI_TEL_PLANE1; + #ifndef SWAP_CORE_SOC + data->svi_core_addr = F17H_M01H_SVI_TEL_PLANE0; + data->svi_soc_addr = F17H_M01H_SVI_TEL_PLANE1; + #else + data->svi_core_addr = F17H_M01H_SVI_TEL_PLANE1; + data->svi_soc_addr = F17H_M01H_SVI_TEL_PLANE0; + #endif for (i = 0; i < ARRAY_SIZE(tctl_offset_table); i++) { const struct tctl_offset *entry = &tctl_offset_table[i]; |