Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
426fccf2
Commit
426fccf2
authored
Apr 23, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bsp/generic: add some comments, no technical change
parent
76e0d3e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
board.c
boards/generic/board.c
+21
-1
bb_spi.c
dev/bb_spi.c
+6
-0
No files found.
boards/generic/board.c
View file @
426fccf2
...
...
@@ -14,18 +14,38 @@ int wrc_board_init()
int
memtype
;
uint32_t
sdbfs_addr
;
uint32_t
sector_size
;
/*
* declare GPIO pins and configure their directions for bit-banging SPI
* limit SPI speed to 10MHz by setting bit_delay = CPU_CLOCK / 10^6
*/
bb_spi_create
(
&
spi_wrc_flash
,
&
pin_sysc_spi_ncs
,
&
pin_sysc_spi_mosi
,
&
pin_sysc_spi_miso
,
&
pin_sysc_spi_sclk
,
1
0
);
&
pin_sysc_spi_sclk
,
CPU_CLOCK
/
1000000
0
);
spi_wrc_flash
.
rd_falling_edge
=
1
;
/*
* Read from gateware info about used memory. Currently only base
* address and sector size for memtype flash is supported.
*/
get_storage_info
(
&
memtype
,
&
sdbfs_addr
,
&
sector_size
);
/*
* Initialize SPI flash and read its ID
*/
spi_flash_create
(
&
wrc_flash_dev
,
&
spi_wrc_flash
,
sector_size
);
/*
* Initialize storage subsystem with newly created SPI Flash
*/
storage_spiflash_create
(
&
wrc_storage_dev
,
&
wrc_flash_dev
);
/*
* Mount SDBFS filesystem from storage.
*/
storage_mount
(
&
wrc_storage_dev
);
return
0
;
}
...
...
dev/bb_spi.c
View file @
426fccf2
...
...
@@ -145,6 +145,12 @@ void bb_spi_xfer(struct spi_bus *bus, uint64_t din, uint64_t *d_out, int n_bits)
}
/*
* Declare GPIOs for bitbanging SPI
* set initial state of outputs
* set SPI speed by configuring bit delay
*/
int
bb_spi_create
(
struct
spi_bus
*
bus
,
struct
gpio_pin
*
pin_cs
,
struct
gpio_pin
*
pin_mosi
,
...
...
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