Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-init
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-init
Commits
c72c69ea
Commit
c72c69ea
authored
Oct 16, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added USB hub initialization, temporary HTML directory
parent
a6ef3908
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
init_elphel393.py
src/init_elphel393.py
+27
-1
No files found.
src/init_elphel393.py
View file @
c72c69ea
...
...
@@ -35,6 +35,7 @@ __status__ = "Development"
import
subprocess
import
sys
import
time
import
os
#params
SENSOR_TYPE
=
5
...
...
@@ -82,12 +83,28 @@ def init_sata(sata_en,pydir):
shout
(
"sleep 2"
)
shout
(
"echo 1 > /sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module"
)
def
init_usb_hub
():
"""
Initializes USB HUB on 10389 board (stays inituialized through reboot, does not respond after initialized)
"""
if
not
os
.
path
.
exists
(
'/sys/bus/usb/devices/1-1'
):
shout
(
"i2cset -y 0 0x2c 0xff 0x0201 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0x00 0x3401 w"
)
shout
(
"i2cset -y 0 0x2c 0x01 0x1201 w"
)
shout
(
"i2cset -y 0 0x2c 0x06 0x9b01 w"
)
shout
(
"i2cset -y 0 0x2c 0x07 0x1001 w"
)
shout
(
"i2cset -y 0 0x2c 0x08 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0101 w"
)
print
(
"Initialized USB hub with Vendor=1234"
)
else
:
print
(
"USB hub was already initialized"
)
#main
# default
switch
=
{
'usb_hub'
:
1
,
'ip'
:
1
,
'mcntrl'
:
1
,
'imgsrv'
:
1
,
...
...
@@ -104,6 +121,15 @@ switch = {
# update from argv
if
len
(
sys
.
argv
)
>
1
:
switch
.
update
(
eval
(
sys
.
argv
[
1
]))
#pre
os
.
mkdir
(
'/var/volatile/html'
)
#0
if
switch
[
'usb_hub'
]
==
1
:
print
(
'Initialize USB hub'
)
init_usb_hub
()
else
:
print
(
"skip USB hub initiualization"
)
#1
if
switch
[
'ip'
]
==
1
:
...
...
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