The information here is for A2 ver. with Charger.
I made a stupid mistake and apply 12V to the board and burned down Fixed PWM IC U13 - 5V/3.3V then I decided that it's better to remove all the IC and have closer look.
Board Ver. A1 ( don't be fooled by the name of the PCB, this is actually router version A2E ) pictures attached too, which is a bit different than what you can see on wiki page: http://wiki.openwrt.org/toh/d-link/dir-505, some of the info here will be the same as wiki too. The info here is shared with hope that it will be useful, may not be a 100% correct if you see any mistakes you can drop a comment. 

Reference: https://wikidevi.com/wiki/Atheros_AR9331
http://wiki.openwrt.org/toh/tp-link/tl- … 331_pinout
IC datasheets

U1 - ATHEROS AR1131-AL1A
U2 - NANYA NT5TU32M16DG-AC
U4/U5 -  Macronix MX25L6406EM2I

U9 - SOT23-5 (MA5) uP7534 Current-Limited, USB Power Distribution Switch
U12 - LAN Magnetics HN16612SG, SOP16
U13 - IC 5V<>3.3V pwm with chip enable function - high active - by default on, marking code: C8-FB /J57, HVSOF 6pin or 16pin + exposed GND? (Model A1 marking code: 7308/1222G/1C013, HVSOF 8pin) if someone have an idea what these marking code means or where to find chip info for both models that would be great!
U19 - Fintek F75204, MSOP-8, USB Charger Controller IC

SW1 - G5B - 6pin - GHz - high frequency antenna switch
SW5 - 4 position selector switch
SW6 - RESET
SW7 - WPS

JP3 - 4 pins 5V power supply
JP4 - 2 pins mechanical connection
J10 - USB connector
P2 - LAN connector

PCB ver. A1

Q1 - LDO +3.3V/2V for U1 AVDD20?
Q1 pin3 R158 2Ω connected to +3.3V - U4(U5) FLASH IC - pin8;
Q1 pin2 - U1 A48 (AVDD20) 2V ;
Q1 pin1 - U1 B41 (CTRL20) EN;

Q3 - LDO +3.3V/+1.8V for U2 RAM IC 
Q3 pin1 EN (gate?) connected to U1 pin A20 /LDO_OUT/
Q3 pin2 +1.8V to U2 RAM IC
Q3 pin3 +3.3V to U13 3.3V LDO

U4(U5) FLASH IC:
U4(U5) pin 1 CS# - U1 pin B49 ( GPIO2 / SPI_CS_0 )
U4(U5) pin 2 SI/SIO1 to R69 1kΩ - U1 pin B50 ( GPIO4 / SPI_MOSI )
U4(U5) pin 3 WP# R64 10kΩ - U1 pin B55 ( VDD33_RF )
U4(U5) pin 5 SI/SIO0 - U1 pin A57 ( GPIO5 / SPI_MISO )
U4(U5) pin 6 SCLK - U1 pin B51 ( GPIO3 / SPI_CLK )
U4(U5) pin 7 HOLD# R65 10kΩ - to U4(U5) pin 8 +VCC
U4(U5) pin 8 +3.3Vcc

PSU board specifications: AC 85-265VAC
U1 - PWM - TNY278GN - 10-21.5W
U15 - OPTOCOUPLE - LTV-817C
D2 - 2227/HD06 - ~~-+
D1&D3 - SB1045L, TO-277, 45V/10A
D5- TL431?
Output 5V/2A but it may be able to supply more!

This PSU / PWM works great even with under specification voltage.
I’ve tested it on 7 different routers A1/A2 and it works down to DC/AC 36V on some, when voltage is DC/AC 42V and up all routers I've tested work great - even can power external USB HDD.
This makes it suitable for very easy "two wire" mod Active PoE 48V!!! PoE also can be done without original PSU with small DC/DC converter in Passive mode: PoE 12-30V/5V, just to save space and/or install other hardware on the original PSU space.
A warning applies! Human life hazad risk: if you do  Active PoE 48V mod then make sure you remove the mains connectors and you can not connect the router to ~110/220V at the same time!!! I’m not responsible for any damage you may do to yourself or others!
TIP: Cut off/unsolder R131&R132 from LAN pins 45&67, then connect LAN pins 45&67 to the PSU board FD3, polarity does not matter, plug in 48V/PoE ethernet wire and you’ll light up! 


USB power and charge control ( hardware only, no software controls ) A2/505L:

U9 - SOT23-5 (MA5) uP7534 Current-Limited, Power Distribution Switches
U9 Pin 1 EN# connected to U19 Pin 1 CEN# through R675 - 0Ω, and U19 pin 1 pull up R669 10kΩ to +3.3 Vdd 

U13 - 5V/3.3V PWM with EN pin control, disabled when SW5 goes to charge position (when low logic level). ( applying 12V but the regulator down! )
U13 - regulator 5V? to 3.3V ( C8-FB J57 16 pin SOP) with EN through R656 10kΩ to +5 Vdd
U13 pin6&7 (EN) - connected to SW5 pin5 through R673 0Ω, when active disables AR1311 +Vdd LDO, and USB D+ D-, and sets correct charger mode levels and disables USB power temporary.

U19 - F75204 USB Charger Controller
U19 pin8 CB# (charger mode) connected to mode switch SW5 pin5 through R673 0Ω (when active is low logic level).

Reset Button - SW6 - GPIO12 /RESET_SWITCH/
(left pin A38,A55 /VDD25/ & right pin next to USB port - A56 )

WPS button - SW7 - GPIO11 /JS/I2S_MCK/UART_RTS
( left pin connected to GND though R8 2Ω; right pin - U1 pin B48 )

Mode selector switch - SW5 -  4 position switch:
Charger/Router or AP/Repeater/Wi-Fi HotSpot
7 pins: pin1 and pin7 (outer ones) and pin4 (middle one) are connected to GND!

Positions and pins:
Charger A2/505L - pin6: connects to U19 pin8 through R673 2Ω ; Disables USB D+ D- and set voltage levels for charging mode; and U13 pin 6&7 ( 3.3V PWM disables power to AR1131); U19 pin1 connects to disables USB power U9 temporary for~1sec
Charger - Only on A1 model without U19 charger IC, SW5 pin is connected to GPIO23 (U1 pin B22), though R643 2Ω
Router or AP - pin5: GPIO20 U1 pin A27 and pull-up resistors 10kΩ and capacitors to GND to U1 pin A55 VDD25
Repeater - pin3: GPIO? NC? and pull-up resistors 10kΩ and capacitors to GND to U1 pin A55 VDD25
Wi-Fi HotSpot: pin2  - GPIO19 U1 pin B23 and pull-up resistors 10kΩ and capacitors to GND to U1 pin A55 VDD25


Free GPIOs ides???:

LEDs D4&D5 are two colour led in one body, D5 is not installed (free bed) and hidden under the shield close to RAM chip, easy accessible for soldering wires if shield top is removed.

D5 not installed:
D5 left pin (next to the RAM chip)  +3.3Vdd
D5 middle pin - Resistor R653 330Ω in series - GPIO18/I2S_CK/SLIC_CLK, U1 pin A28
D5 left pin ( led D4 on the left ) - Resistor R92 330Ω in series - GPIO21 /I2S_MCK/ SLIC_DATA_OUT/, U1 pin B25

D4 red/green status led:
D4 right pin - +3.3 Vdd
D4 middle pin - Resistor R133 330Ω - GPIO26 /LED8/
D4 left pin next to USB port - Resistor R134 330Ω - GPIO27 /LED7/

R673 next to it there is free pad - connected to GPIO8/JTAG_TMS/I2S_SD - U1 A52 pin - only available on A2 Charger model!!!

TP13 - RX - R173 5K - GPIO09 /UART_SIN/SPI_CS_1 - U1 pin B68
TP12 - TX - R172 2Ω - GPIO10 / UART_SOUT/ SPI_CS_2 - U1 pin A79
TP11 - GND
TP10 - +3.3V

GPIO00-01,13-17,28 exposed and connected to GND / VDD25 ( U1 pin B39 ) through R 10kΩ, R187-189,R193-198, R202-203, R650-651, can they be used as usable GPIO?

This router should support VLAN, how to setup, ideas?

Board DIR-505 A1 and A2 (DIR-505L?) are a little bit different, but over all only significant difference is A1 ( has a big mount hole next to AR1131 on the PCB ver. 1232) - SW5 Mode switch in Charger position pin is connected to GPIO23 (U1 pin B22) and does not cut-off the router power in Charger position.
A2 model is not connected to GPIO23 (U1 pin B22),they use it for hardware control <> USB fast charging process and shutdown the power of the router. It has a different U13 5V/3.3V IC with EN, and one additional IC for the charge U19 compliance, also U9 is involved in the process too.
There is no difference from software point of view.

PCB without components photos: https://www.flickr.com/photos/53731093@ … res/53jsE6

Cheers,

(Last edited by mveplus on 21 Oct 2015, 05:00)