ath79: improve support for Dongwon T&I DW02-412H
* Move &nand node to DTSI * Utilize nvmem for fetching caldata * Rename build recipe, clean before build * Simplify KERNEL definition Signed-off-by: Sungbo Eo <mans0n@gorani.run>
This commit is contained in:
		| @@ -7,28 +7,6 @@ | |||||||
| 	compatible = "dongwon,dw02-412h-128m", "qca,qca9557"; | 	compatible = "dongwon,dw02-412h-128m", "qca,qca9557"; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| &nand { | &ubi { | ||||||
| 	status = "okay"; | 	reg = <0x1800000 0x6800000>; | ||||||
|  |  | ||||||
| 	partitions { |  | ||||||
| 		compatible = "fixed-partitions"; |  | ||||||
| 		#address-cells = <1>; |  | ||||||
| 		#size-cells = <1>; |  | ||||||
|  |  | ||||||
| 		partition@0 { |  | ||||||
| 			label = "current"; |  | ||||||
| 			reg = <0x0 0x1000000>; |  | ||||||
| 			read-only; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		partition@1000000 { |  | ||||||
| 			label = "kernel"; |  | ||||||
| 			reg = <0x1000000 0x800000>; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		partition@1800000 { |  | ||||||
| 			label = "ubi"; |  | ||||||
| 			reg = <0x1800000 0x6800000>; |  | ||||||
| 		}; |  | ||||||
| 	}; |  | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -7,28 +7,6 @@ | |||||||
| 	compatible = "dongwon,dw02-412h-64m", "qca,qca9557"; | 	compatible = "dongwon,dw02-412h-64m", "qca,qca9557"; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| &nand { | &ubi { | ||||||
| 	status = "okay"; | 	reg = <0x1800000 0x2800000>; | ||||||
|  |  | ||||||
| 	partitions { |  | ||||||
| 		compatible = "fixed-partitions"; |  | ||||||
| 		#address-cells = <1>; |  | ||||||
| 		#size-cells = <1>; |  | ||||||
|  |  | ||||||
| 		partition@0 { |  | ||||||
| 			label = "current"; |  | ||||||
| 			reg = <0x0 0x1000000>; |  | ||||||
| 			read-only; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		partition@1000000 { |  | ||||||
| 			label = "kernel"; |  | ||||||
| 			reg = <0x1000000 0x800000>; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		partition@1800000 { |  | ||||||
| 			label = "ubi"; |  | ||||||
| 			reg = <0x1800000 0x2800000>; |  | ||||||
| 		}; |  | ||||||
| 	}; |  | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -97,30 +97,74 @@ | |||||||
| 				read-only; | 				read-only; | ||||||
| 			}; | 			}; | ||||||
|  |  | ||||||
| 			art: partition@1f0000 { | 			partition@1f0000 { | ||||||
| 				label = "art"; | 				label = "art"; | ||||||
| 				reg = <0x1f0000 0x010000>; | 				reg = <0x1f0000 0x010000>; | ||||||
| 				read-only; | 				read-only; | ||||||
|  |  | ||||||
|  | 				compatible = "nvmem-cells"; | ||||||
|  | 				#address-cells = <1>; | ||||||
|  | 				#size-cells = <1>; | ||||||
|  |  | ||||||
|  | 				macaddr_art_0: macaddr@0 { | ||||||
|  | 					reg = <0x0 0x6>; | ||||||
|  | 				}; | ||||||
|  |  | ||||||
|  | 				cal_art_1000: cal@1000 { | ||||||
|  | 					reg = <0x1000 0x440>; | ||||||
|  | 				}; | ||||||
|  |  | ||||||
|  | 				cal_art_5000: cal@5000 { | ||||||
|  | 					reg = <0x5000 0x844>; | ||||||
|  | 				}; | ||||||
| 			}; | 			}; | ||||||
| 		}; | 		}; | ||||||
| 	}; | 	}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | &nand { | ||||||
|  | 	status = "okay"; | ||||||
|  |  | ||||||
|  | 	partitions { | ||||||
|  | 		compatible = "fixed-partitions"; | ||||||
|  | 		#address-cells = <1>; | ||||||
|  | 		#size-cells = <1>; | ||||||
|  |  | ||||||
|  | 		partition@0 { | ||||||
|  | 			label = "current"; | ||||||
|  | 			reg = <0x0 0x1000000>; | ||||||
|  | 			read-only; | ||||||
|  | 		}; | ||||||
|  |  | ||||||
|  | 		partition@1000000 { | ||||||
|  | 			label = "kernel"; | ||||||
|  | 			reg = <0x1000000 0x800000>; | ||||||
|  | 		}; | ||||||
|  |  | ||||||
|  | 		ubi: partition@1800000 { | ||||||
|  | 			label = "ubi"; | ||||||
|  | 		}; | ||||||
|  | 	}; | ||||||
|  | }; | ||||||
|  |  | ||||||
| &pcie0 { | &pcie0 { | ||||||
| 	status = "okay"; | 	status = "okay"; | ||||||
|  |  | ||||||
| 	wifi@0,0 { | 	wifi@0,0 { | ||||||
| 		compatible = "qcom,ath10k"; | 		compatible = "qcom,ath10k"; | ||||||
| 		reg = <0 0 0 0 0>; | 		reg = <0 0 0 0 0>; | ||||||
|  |  | ||||||
|  | 		nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; | ||||||
|  | 		nvmem-cell-names = "mac-address", "calibration"; | ||||||
|  | 		mac-address-increment = <4>; | ||||||
| 	}; | 	}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| &wmac { | &wmac { | ||||||
| 	status = "okay"; | 	status = "okay"; | ||||||
|  |  | ||||||
| 	mtd-cal-data = <&art 0x1000>; | 	nvmem-cells = <&macaddr_art_0>, <&cal_art_1000>; | ||||||
| 	nvmem-cells = <&macaddr_art_0>; | 	nvmem-cell-names = "mac-address", "calibration"; | ||||||
| 	nvmem-cell-names = "mac-address"; |  | ||||||
| 	mac-address-increment = <3>; | 	mac-address-increment = <3>; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @@ -144,8 +188,8 @@ | |||||||
| 			0x54 0x00000000 /* LED Control Register 1 */ | 			0x54 0x00000000 /* LED Control Register 1 */ | ||||||
| 			0x58 0x00000000 /* LED Control Register 2 */ | 			0x58 0x00000000 /* LED Control Register 2 */ | ||||||
| 			0x5c 0x0030c300 /* LED Control Register 3 */ | 			0x5c 0x0030c300 /* LED Control Register 3 */ | ||||||
| 			0x7c 0x0000007e	/* PORT0_STATUS */ | 			0x7c 0x0000007e /* PORT0_STATUS */ | ||||||
| 			>; | 		>; | ||||||
| 	}; | 	}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @@ -163,13 +207,3 @@ | |||||||
| 		rgmii-enabled = <1>; | 		rgmii-enabled = <1>; | ||||||
| 	}; | 	}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| &art { |  | ||||||
| 	compatible = "nvmem-cells"; |  | ||||||
| 	#address-cells = <1>; |  | ||||||
| 	#size-cells = <1>; |  | ||||||
|  |  | ||||||
| 	macaddr_art_0: macaddr@0 { |  | ||||||
| 		reg = <0x0 0x6>; |  | ||||||
| 	}; |  | ||||||
| }; |  | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| define Build/dw-headers | define Build/dongwon-header | ||||||
| 	head -c 4 $@ >> $@.tmp && \ | 	head -c 4 $@ > $@.tmp | ||||||
| 	head -c 8 /dev/zero >> $@.tmp && \ | 	head -c 8 /dev/zero >> $@.tmp | ||||||
| 	tail -c +9 $@ >> $@.tmp && \ | 	tail -c +9 $@ >> $@.tmp | ||||||
| 	( \ | 	( \ | ||||||
| 		header_crc="$$(head -c 68 $@.tmp | gzip -c | \ | 		header_crc="$$(head -c 68 $@.tmp | gzip -c | \ | ||||||
| 			tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ | 			tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ | ||||||
| @@ -99,8 +99,8 @@ define Device/dongwon_dw02-412h | |||||||
|   KERNEL_SIZE := 8192k |   KERNEL_SIZE := 8192k | ||||||
|   BLOCKSIZE := 128k |   BLOCKSIZE := 128k | ||||||
|   PAGESIZE := 2048 |   PAGESIZE := 2048 | ||||||
|   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers |   KERNEL := $$(KERNEL) | dongwon-header | ||||||
|   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers |   KERNEL_INITRAMFS := $$(KERNEL) | ||||||
|   UBINIZE_OPTS := -E 5 |   UBINIZE_OPTS := -E 5 | ||||||
|   IMAGES += factory.img |   IMAGES += factory.img | ||||||
|   IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ |   IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ | ||||||
|   | |||||||
| @@ -13,11 +13,6 @@ case "$FIRMWARE" in | |||||||
| 		caldata_extract "art" 0x5000 0x844 | 		caldata_extract "art" 0x5000 0x844 | ||||||
| 		ath10k_patch_mac $(mtd_get_mac_binary art 0x12) | 		ath10k_patch_mac $(mtd_get_mac_binary art 0x12) | ||||||
| 		;; | 		;; | ||||||
| 	dongwon,dw02-412h-64m|\ |  | ||||||
| 	dongwon,dw02-412h-128m) |  | ||||||
| 		caldata_extract "art" 0x5000 0x844 |  | ||||||
| 		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 4) |  | ||||||
| 		;; |  | ||||||
| 	glinet,gl-ar750s-nor|\ | 	glinet,gl-ar750s-nor|\ | ||||||
| 	glinet,gl-ar750s-nor-nand) | 	glinet,gl-ar750s-nor-nand) | ||||||
| 		caldata_extract "art" 0x5000 0x844 | 		caldata_extract "art" 0x5000 0x844 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sungbo Eo
					Sungbo Eo