BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openwrt-zsun
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Forest Godfrey
openwrt-zsun
Commits
3bd9e3db
Commit
3bd9e3db
authored
Nov 08, 2015
by
Andrzej Surowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for ZSUN WiFi SD Card Reader
parent
483dac82
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
192 additions
and
7 deletions
+192
-7
diag.sh
target/linux/ar71xx/base-files/etc/diag.sh
+3
-0
02_network
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+1
-0
99_zsun-enable-wifi
...ux/ar71xx/base-files/etc/uci-defaults/99_zsun-enable-wifi
+8
-0
ar71xx.sh
target/linux/ar71xx/base-files/lib/ar71xx.sh
+3
-0
50_failsafe_wipe
target/linux/ar71xx/base-files/lib/preinit/50_failsafe_wipe
+12
-0
platform.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+2
-1
config-3.18
target/linux/ar71xx/config-3.18
+1
-0
mach-zsun-sdreader.c
...t/linux/ar71xx/files/arch/mips/ath79/mach-zsun-sdreader.c
+96
-0
zsun.mk
target/linux/ar71xx/generic/profiles/zsun.mk
+18
-0
Makefile
target/linux/ar71xx/image/Makefile
+9
-1
415-mtd-m25p80-add-w25q128fw.patch
...ux/ar71xx/patches-3.18/415-mtd-m25p80-add-w25q128fw.patch
+21
-0
610-MIPS-ath79-openwrt-machines.patch
...ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
+18
-5
No files found.
target/linux/ar71xx/base-files/etc/diag.sh
View file @
3bd9e3db
...
...
@@ -345,6 +345,9 @@ get_status_led() {
wlr8100
)
status_led
=
"sitecom:amber:status"
;;
zsun-sdreader
)
status_led
=
"zsunsdreader:green:system"
;;
esac
}
...
...
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
View file @
3bd9e3db
...
...
@@ -361,6 +361,7 @@ tl-wr703n |\
tube2h
|
\
wndap360
|
\
mynet-rext
|
\
zsun-sdreader
|
\
wp543
)
ucidef_set_interface_lan
"eth0"
;;
...
...
target/linux/ar71xx/base-files/etc/uci-defaults/99_zsun-enable-wifi
0 → 100644
View file @
3bd9e3db
#!/bin/sh
uci
set
wireless.@wifi-device[0].disabled
=
0
uci commit wireless
wifi
exit
0
\ No newline at end of file
target/linux/ar71xx/base-files/lib/ar71xx.sh
View file @
3bd9e3db
...
...
@@ -925,6 +925,9 @@ ar71xx_board_detect() {
*
"HiWiFi HC6361"
)
name
=
"hiwifi-hc6361"
;;
*
"ZSUN WiFi SD Card Reader"
)
name
=
"zsun-sdreader"
;;
esac
[
-z
"
$AR71XX_MODEL
"
]
&&
[
"
${
machine
:0:8
}
"
=
'TP-LINK '
]
&&
\
...
...
target/linux/ar71xx/base-files/lib/preinit/50_failsafe_wipe
0 → 100644
View file @
3bd9e3db
#!/bin/sh
failsafe_wipe
()
{
echo
"Doing a factory reset."
mount_root
firstboot
-y
sleep
10
reboot
-f
}
boot_hook_add failsafe failsafe_wipe
\ No newline at end of file
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
View file @
3bd9e3db
...
...
@@ -188,7 +188,8 @@ platform_check_image() {
mr16
|
\
wpj558
|
\
zcn-1523h-2
|
\
zcn-1523h-5
)
zcn-1523h-5
|
\
zsun-sdreader
)
[
"
$magic_long
"
!=
"68737173"
-a
"
$magic_long
"
!=
"19852003"
]
&&
{
echo
"Invalid image type."
return
1
...
...
target/linux/ar71xx/config-3.18
View file @
3bd9e3db
...
...
@@ -156,6 +156,7 @@ CONFIG_ATH79_MACH_WZR_HP_G300NH=y
CONFIG_ATH79_MACH_WZR_HP_G300NH2=y
CONFIG_ATH79_MACH_WZR_HP_G450H=y
CONFIG_ATH79_MACH_ZCN_1523H=y
CONFIG_ATH79_MACH_ZSUN_SDREADER=y
CONFIG_ATH79_NVRAM=y
CONFIG_ATH79_PCI_ATH9K_FIXUP=y
# CONFIG_ATH79_ROUTERBOOT is not set
...
...
target/linux/ar71xx/files/arch/mips/ath79/mach-zsun-sdreader.c
0 → 100644
View file @
3bd9e3db
/*
* ZSUN WiFi SD Card Reader support
*
* Copyright (C) 2015 by Andrzej Surowiec <emeryth@hackerspace.pl>
* Based on mach-carambola2.c copyright (C) 2013 Darius Augulis <darius@8devices.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
#include "common.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "dev-spi.h"
#include "dev-usb.h"
#include "dev-wmac.h"
#include "machtypes.h"
#define ZSUN_SDREADER_GPIO_LED_SYSTEM 0
#define ZSUN_SDREADER_GPIO_SW_SD 22
#define ZSUN_SDREADER_MAC0_OFFSET 0x0000
#define ZSUN_SDREADER_MAC1_OFFSET 0x0006
#define ZSUN_SDREADER_CALDATA_OFFSET 0x1000
#define ZSUN_SDREADER_WMAC_MAC_OFFSET 0x1002
#define ZSUN_SDREADER_KEYS_POLL_INTERVAL 20
/* msecs */
#define ZSUN_SDREADER_KEYS_DEBOUNCE_INTERVAL (3 * ZSUN_SDREADER_KEYS_POLL_INTERVAL)
static
struct
gpio_led
zsun_sdreader_leds_gpio
[]
__initdata
=
{
{
.
name
=
"zsunsdreader:green:system"
,
.
gpio
=
ZSUN_SDREADER_GPIO_LED_SYSTEM
,
.
active_low
=
0
,
}
};
static
struct
gpio_keys_button
zsun_sdreader_gpio_keys
[]
__initdata
=
{
{
.
desc
=
"SD Card insert switch"
,
.
type
=
EV_KEY
,
.
code
=
BTN_1
,
.
debounce_interval
=
ZSUN_SDREADER_KEYS_DEBOUNCE_INTERVAL
,
.
gpio
=
ZSUN_SDREADER_GPIO_SW_SD
,
.
active_low
=
1
,
}
};
static
void
__init
zsun_sdreader_common_setup
(
void
)
{
u8
*
art
=
(
u8
*
)
KSEG1ADDR
(
0x1fff0000
);
ath79_register_m25p80
(
NULL
);
ath79_register_wmac
(
art
+
ZSUN_SDREADER_CALDATA_OFFSET
,
art
+
ZSUN_SDREADER_WMAC_MAC_OFFSET
);
ath79_setup_ar933x_phy4_switch
(
true
,
true
);
//ath79_init_mac(ath79_eth0_data.mac_addr, art + ZSUN_SDREADER_MAC0_OFFSET, 0);
ath79_init_mac
(
ath79_eth1_data
.
mac_addr
,
art
+
ZSUN_SDREADER_MAC1_OFFSET
,
0
);
ath79_register_mdio
(
0
,
0x0
);
//ath79_register_eth(0);
ath79_register_eth
(
1
);
}
static
void
__init
zsun_sdreader_setup
(
void
)
{
zsun_sdreader_common_setup
();
ath79_gpio_function_disable
(
AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN
|
AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN
|
AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN
|
AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN
|
AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN
);
ath79_register_leds_gpio
(
-
1
,
ARRAY_SIZE
(
zsun_sdreader_leds_gpio
),
zsun_sdreader_leds_gpio
);
ath79_register_gpio_keys_polled
(
-
1
,
ZSUN_SDREADER_KEYS_POLL_INTERVAL
,
ARRAY_SIZE
(
zsun_sdreader_gpio_keys
),
zsun_sdreader_gpio_keys
);
ath79_register_usb
();
}
MIPS_MACHINE
(
ATH79_MACH_ZSUN_SDREADER
,
"ZSUN-SDREADER"
,
"ZSUN WiFi SD Card Reader"
,
zsun_sdreader_setup
);
target/linux/ar71xx/generic/profiles/zsun.mk
0 → 100644
View file @
3bd9e3db
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/ZSUNSDREADER
NAME:=ZSUN WiFi SD Card reader
PACKAGES:=kmod-usb-core kmod-usb2 kmod-usb-storage
endef
define Profile/ZSUNSDREADER/Description
Package set optimized for the ZSUN WiFi SD Card Reader.
endef
$(eval $(call Profile,ZSUNSDREADER))
\ No newline at end of file
target/linux/ar71xx/image/Makefile
View file @
3bd9e3db
...
...
@@ -661,6 +661,12 @@ define Device/oolite
endef
TARGET_DEVICES
+=
oolite
define
Device/zsun-sdreader
BOARDNAME
:=
ZSUN-SDREADER
CONSOLE
=
ttyATH0,115200
endef
TARGET_DEVICES
+=
zsun-sdreader
rootfs_type
=
$
(
patsubst jffs2-%,jffs2,
$
(
patsubst squashfs-%,squashfs,
$
(
1
)))
# $(1): rootfs type.
...
...
@@ -988,7 +994,7 @@ mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdat
mynet_rext_mtdlayout
=
mtdparts
=
spi0.0:256k
(
u-boot
)
ro,7808k
(
firmware
)
,64k
(
nvram
)
ro,64k
(
ART
)
ro
zyx_nbg6716_mtdlayout
=
mtdparts
=
spi0.0:256k
(
u-boot
)
ro,64k
(
env
)
ro,64k
(
RFdata
)
ro,-
(
nbu
)
;
ar934x-nfc:2048k
(
zyxel_rfsd
)
,2048k
(
romd
)
,1024k
(
header
)
,2048k
(
kernel
)
,-
(
ubi
)
qihoo_c301_mtdlayout
=
mtdparts
=
spi0.0:256k
(
u-boot
)
ro,64k
(
u-boot-env
)
,64k
(
devdata
)
,64k
(
devconf
)
,15744k
(
firmware
)
,64k
(
warm_start
)
,64k
(
action_image_config
)
,64k
(
radiocfg
)
ro
;
spi0.1:15360k
(
upgrade2
)
,1024k
(
privatedata
)
zsun_sdreader_mtdlayout
=
mtdparts
=
spi0.0:64k
(
u-boot
)
ro,64k
(
u-boot-env
)
ro,14912k
(
rootfs
)
,1216k
(
kernel
)
,64k
(
nvram
)
,64k
(
art
)
,16128k@0x20000
(
firmware
)
define
Image/BuildKernel
cp
$(KDIR)/vmlinux.elf
$(VMLINUX).elf
...
...
@@ -1866,6 +1872,8 @@ $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(
$(eval
$(call
SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
$(eval
$(call
SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
$(eval
$(call
SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
$(eval
$(call
SingleProfile,AthLzma,64k,ZSUNSDREADER,zsun-sdreader,ZSUN-SDREADER,ttyATH0,115200,$$(zsun_sdreader_mtdlayout),RKuImage))
$(eval
$(call
SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
...
...
target/linux/ar71xx/patches-3.18/415-mtd-m25p80-add-w25q128fw.patch
0 → 100644
View file @
3bd9e3db
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -312,7 +312,7 @@ static const struct spi_device_id m25p_i
{"w25x10"}, {"w25x20"}, {"w25x40"}, {"w25x80"},
{"w25x16"}, {"w25x32"}, {"w25q32"}, {"w25q32dw"},
{"w25x64"}, {"w25q64"}, {"w25q80"}, {"w25q80bl"},
- {"w25q128"}, {"w25q256"}, {"cat25c11"},
+ {"w25q128"}, {"w25q128fw"}, {"w25q256"}, {"cat25c11"},
{"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"},
{ },
};
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -634,6 +634,7 @@ static const struct spi_device_id spi_no
{ "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) },
{ "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) },
{ "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
+ { "w25q128fw", INFO(0xef6018, 0, 64 * 1024, 256, SECT_4K) },
{ "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K) },
/* Catalyst / On Semiconductor -- non-JEDEC */
target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
View file @
3bd9e3db
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
@@ -16,22 +16,19
5
@@
@@ -16,22 +16,19
6
@@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
...
...
@@ -193,6 +193,7 @@
+ ATH79_MACH_WZR_450HP2, /* Buffalo WZR-450HP2 */
+ ATH79_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */
+ ATH79_MACH_ZCN_1523H_5, /* Zcomax ZCN-1523H-5-xx */
+ ATH79_MACH_ZSUN_SDREADER, /* Zsun WiFi SD Card Reader */
};
#endif /* _ATH79_MACHTYPE_H */
...
...
@@ -1328,7 +1329,7 @@
config ATH79_MACH_UBNT_XM
bool "Ubiquiti Networks XM/UniFi boards"
@@ -83,6 +1115,
9
7 @@ config ATH79_MACH_UBNT_XM
@@ -83,6 +1115,
10
7 @@ config ATH79_MACH_UBNT_XM
Say 'Y' here if you want your kernel to support the
Ubiquiti Networks XM (rev 1.0) board.
...
...
@@ -1423,10 +1424,20 @@
+ select ATH79_DEV_USB
+ select ATH79_NVRAM
+
+config ATH79_MACH_ZSUN_SDREADER
+ bool "ZSUN WiFi SD Card Reader"
+ select SOC_AR933X
+ select ATH79_DEV_ETH
+ select ATH79_DEV_GPIO_BUTTONS
+ select ATH79_DEV_LEDS_GPIO
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
+
endmenu
config SOC_AR71XX
@@ -124,7 +12
4
7,10 @@ config ATH79_DEV_DSA
@@ -124,7 +12
5
7,10 @@ config ATH79_DEV_DSA
config ATH79_DEV_ETH
def_bool n
...
...
@@ -1438,7 +1449,7 @@
def_bool n
config ATH79_DEV_GPIO_BUTTONS
@@ -154,6 +12
8
0,11 @@ config ATH79_PCI_ATH9K_FIXUP
@@ -154,6 +12
9
0,11 @@ config ATH79_PCI_ATH9K_FIXUP
def_bool n
config ATH79_ROUTERBOOT
...
...
@@ -1452,7 +1463,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
@@ -38,9 +38,12
4
@@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
@@ -38,9 +38,12
6
@@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
...
...
@@ -1577,6 +1588,8 @@
+obj-$(CONFIG_ATH79_MACH_ZCN_1523H) += mach-zcn-1523h.o
+obj-$(CONFIG_ATH79_MACH_CARAMBOLA2) += mach-carambola2.o
+obj-$(CONFIG_ATH79_MACH_NBG6716) += mach-nbg6716.o
+obj-$(CONFIG_ATH79_MACH_ZSUN_SDREADER) += mach-zsun-sdreader.o
+
--- a/arch/mips/ath79/prom.c
+++ b/arch/mips/ath79/prom.c
@@ -180,6 +180,12 @@ void __init prom_init(void)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment