add pspboot support, cleanup in ar7 board support

SVN-Revision: 1611
master
Felix Fietkau 19 years ago
parent 544736f3e2
commit 6c3d9c2ca8
  1. 5
      openwrt/target/linux/image/ar7/Makefile
  2. 3917
      openwrt/target/linux/linux-2.4/patches/ar7/000-ar7_support.patch
  3. 12
      openwrt/target/utils/src/addpattern.c

@ -64,14 +64,15 @@ $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin: $(BIN_DIR)/openwrt-ar7-2.4-kernel.bi
define pattern_template
$(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin: $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin
(dd if=/dev/zero bs=16 count=1; cat $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin) | \
$(STAGING_DIR)/bin/addpattern -p $(1) -o $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin
$(STAGING_DIR)/bin/addpattern -p $(1) $(2) -o $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin
install: $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin
endef
$(eval $(call pattern_template,WA22))
$(eval $(call pattern_template,WAG2))
$(eval $(call pattern_template,WA21))
$(eval $(call pattern_template,WA32,-b))
clean:
rm -rf $(PKG_BUILD_DIR)

@ -50,6 +50,7 @@
#define CODE_ID "U2ND" /* from code_pattern.h */
#define CODE_PATTERN "W54S" /* from code_pattern.h */
#define PBOT_PATTERN "PBOT"
#define CYBERTAN_VERSION "v3.37.2" /* from cyutils.h */
@ -75,7 +76,7 @@ void usage(void) __attribute__ (( __noreturn__ ));
void usage(void)
{
fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1|2}]\n");
fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-b] [-v v#.#.#] [-{0|1|2}]\n");
exit(EXIT_FAILURE);
}
@ -88,8 +89,10 @@ int main(int argc, char **argv)
char *ifn = NULL;
char *ofn = NULL;
char *pattern = CODE_PATTERN;
char *pbotpat = PBOT_PATTERN;
char *version = CYBERTAN_VERSION;
int gflag = 0;
int pbotflag = 0;
int c;
int v0, v1, v2;
size_t off, n;
@ -101,7 +104,7 @@ int main(int argc, char **argv)
hdr = (struct code_header *) buf;
memset(hdr, 0, sizeof(struct code_header));
while ((c = getopt(argc, argv, "i:o:p:gv:012")) != -1) {
while ((c = getopt(argc, argv, "i:o:p:gbv:012")) != -1) {
switch (c) {
case 'i':
ifn = optarg;
@ -115,6 +118,9 @@ int main(int argc, char **argv)
case 'g':
gflag = 1;
break;
case 'b':
pbotflag = 1;
break;
case 'v': /* extension to allow setting version */
version = optarg;
break;
@ -169,6 +175,8 @@ int main(int argc, char **argv)
}
memcpy(&hdr->magic, pattern, 4);
if (pbotflag)
memcpy(&hdr->res1, pbotpat, 4);
hdr->fwdate[0] = ptm->tm_year % 100;
hdr->fwdate[1] = ptm->tm_mon + 1;
hdr->fwdate[2] = ptm->tm_mday;

Loading…
Cancel
Save