From 4377351db43c94d400124a3948a0e70bde878289 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 26 Mar 2007 07:32:10 +0000 Subject: Preserve fw_arg0-3 to allow runtime bootloader detection (Gabor Juhos) SVN-Revision: 6711 --- .../adm5120-2.6/image/lzma-loader/src/decompress.c | 12 +++++- .../linux/adm5120-2.6/image/lzma-loader/src/head.S | 43 ++++++++++++++-------- 2 files changed, 37 insertions(+), 18 deletions(-) (limited to 'target') diff --git a/target/linux/adm5120-2.6/image/lzma-loader/src/decompress.c b/target/linux/adm5120-2.6/image/lzma-loader/src/decompress.c index b0ed2fc8c4..d3610241f6 100644 --- a/target/linux/adm5120-2.6/image/lzma-loader/src/decompress.c +++ b/target/linux/adm5120-2.6/image/lzma-loader/src/decompress.c @@ -30,6 +30,9 @@ * 24-Apr-2005 Oleg I. Vdovikin * reordered functions using lds script, removed forward decl * + * 24-Mar-2007 Gabor Juhos + * pass original values of the a0,a1,a2,a3 registers to the kernel + * */ #include "LzmaDecode.h" @@ -93,6 +96,9 @@ extern unsigned char workspace[]; unsigned int offset; unsigned char *data; +typedef void (*kernel_entry)(unsigned long reg_a0, unsigned long reg_a1, + unsigned long reg_a2, unsigned long reg_a3); + /* flash access should be aligned, so wrapper is used */ /* read byte from the flash, all accesses are 32-bit aligned */ static int read_byte(void *object, unsigned char **buffer, UInt32 *bufferSize) @@ -119,7 +125,9 @@ static __inline__ unsigned char get_byte(void) } /* should be the first function */ -void entry(unsigned long icache_size, unsigned long icache_lsize, +void entry(unsigned long reg_a0, unsigned long reg_a1, + unsigned long reg_a2, unsigned long reg_a3, + unsigned long icache_size, unsigned long icache_lsize, unsigned long dcache_size, unsigned long dcache_lsize) { unsigned int i; /* temp value */ @@ -173,7 +181,7 @@ void entry(unsigned long icache_size, unsigned long icache_lsize, /* Jump to load address */ uart_write_str("ok\r\n"); - ((void (*)(void)) LOADADDR)(); + ((kernel_entry) LOADADDR)(reg_a0, reg_a1, reg_a2, reg_a3); } uart_write_str("failed\r\n"); while (1 ); diff --git a/target/linux/adm5120-2.6/image/lzma-loader/src/head.S b/target/linux/adm5120-2.6/image/lzma-loader/src/head.S index 9bfbd53d51..7f0e9adc0d 100644 --- a/target/linux/adm5120-2.6/image/lzma-loader/src/head.S +++ b/target/linux/adm5120-2.6/image/lzma-loader/src/head.S @@ -1,3 +1,6 @@ +/* Copyright 2007 Gabor Juhos */ +/* keep original values of the a0,a1,a2,a3 registers */ +/* cache manipulation adapted from Broadcom code */ /* Copyright 2005 Oleg I. Vdovikin (oleg@cs.msu.su) */ /* cache manipulation adapted from Broadcom code */ /* idea taken from original bunzip2 decompressor code */ @@ -40,18 +43,17 @@ .set noreorder /* Copy decompressor code to the right place */ - li t2, BZ_TEXT_START - add a0, t2, 0 - la a1, code_start - la a2, code_stop + li t0, BZ_TEXT_START + + la t1, code_start + la t2, code_stop $L1: - lw t0, 0(a1) - sw t0, 0(a0) - add a1, 4 - add a0, 4 - blt a1, a2, $L1 - nop - + lw t3, 0(t1) + sw t3, 0(t0) + add t1, 4 + blt t1, t2, $L1 + add t0, 4 + /* At this point we need to invalidate dcache and */ /* icache before jumping to new code */ @@ -145,11 +147,20 @@ nodc: addu t0,s3 noic: - move a0,s3 /* icache line size */ - move a1,s4 /* icache size */ - move a2,s1 /* dcache line size */ - jal t2 - move a3,s2 /* dcache size */ + li t0, BZ_TEXT_START + + addiu sp, -32 /* reserve stack for parameters */ +#if 0 + sw a0, 0(sp) + sw a1, 4(sp) + sw a2, 8(sp) + sw a3, 12(sp) +#endif + sw s3, 16(sp) /* icache line size */ + sw s4, 20(sp) /* icache size */ + sw s1, 24(sp) /* dcache line size */ + jr t0 + sw s2, 28(sp) /* dcache size */ .set reorder END(startup) -- cgit v1.2.3 859aa492'>mt76/patches/001-mac80211-4-14-api.patch
blob: 6cff15b1969edfb6c1343c82da57e3f015689be9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
--- a/mt76x2_mac.c
+++ b/mt76x2_mac.c
@@ -46,7 +46,7 @@ mt76x2_mac_process_rate(struct ieee80211
 	case MT_PHY_TYPE_CCK:
 		if (idx >= 8) {
 			idx -= 8;
-			status->flag |= RX_FLAG_SHORTPRE;
+			status->enc_flags |= RX_ENC_FLAG_SHORTPRE;
 		}
 
 		if (idx >= 4)
@@ -55,16 +55,16 @@ mt76x2_mac_process_rate(struct ieee80211
 		status->rate_idx = idx;
 		return;
 	case MT_PHY_TYPE_HT_GF:
-		status->flag |= RX_FLAG_HT_GF;
+		status->enc_flags |= RX_ENC_FLAG_HT_GF;
 		/* fall through */
 	case MT_PHY_TYPE_HT:
-		status->flag |= RX_FLAG_HT;
+		status->encoding = RX_ENC_HT;
 		status->rate_idx = idx;
 		break;
 	case MT_PHY_TYPE_VHT:
-		status->flag |= RX_FLAG_VHT;
+		status->encoding = RX_ENC_VHT;
 		status->rate_idx = FIELD_GET(MT_RATE_INDEX_VHT_IDX, idx);
-		status->vht_nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1;
+		status->nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1;
 		break;
 	default:
 		WARN_ON(1);
@@ -72,22 +72,22 @@ mt76x2_mac_process_rate(struct ieee80211
 	}
 
 	if (rate & MT_RXWI_RATE_LDPC)
-		status->flag |= RX_FLAG_LDPC;
+		status->enc_flags |= RX_ENC_FLAG_LDPC;
 
 	if (rate & MT_RXWI_RATE_SGI)
-		status->flag |= RX_FLAG_SHORT_GI;
+		status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
 
 	if (rate & MT_RXWI_RATE_STBC)
-		status->flag |= 1 << RX_FLAG_STBC_SHIFT;
+		status->enc_flags |= 1 << RX_ENC_FLAG_STBC_SHIFT;
 
 	switch (FIELD_GET(MT_RXWI_RATE_BW, rate)) {
 	case MT_PHY_BW_20:
 		break;
 	case MT_PHY_BW_40:
-		status->flag |= RX_FLAG_40MHZ;
+		status->bw = RATE_INFO_BW_40;
 		break;
 	case MT_PHY_BW_80:
-		status->vht_flag |= RX_VHT_FLAG_80MHZ;
+		status->bw = RATE_INFO_BW_80;
 		break;
 	default:
 		break;
--- a/mt7603_mac.c
+++ b/mt7603_mac.c
@@ -411,19 +411,19 @@ mt7603_mac_fill_rx(struct mt7603_dev *de
 			break;
 		case MT_PHY_TYPE_HT_GF:
 		case MT_PHY_TYPE_HT:
-			status->flag |= RX_FLAG_HT;
+			status->encoding = RX_ENC_HT;
 			break;
 		case MT_PHY_TYPE_VHT:
-			status->flag |= RX_FLAG_VHT;
+			status->encoding = RX_ENC_VHT;
 			break;
 		default:
 			WARN_ON(1);
 		}
 
 		if (rxdg0 & MT_RXV1_HT_SHORT_GI)
-			status->flag |= RX_FLAG_SHORT_GI;
+			status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
 
-		status->flag |= RX_FLAG_STBC_MASK *
+		status->enc_flags |= RX_ENC_FLAG_STBC_MASK *
 				    FIELD_GET(MT_RXV1_HT_STBC, rxdg0);
 
 		status->rate_idx = i;