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
78c2adc5
Commit
78c2adc5
authored
Jan 11, 2023
by
Antonin Broquet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
city uses WRPC v5 with low phase drift phy.
parent
6753610c
Pipeline
#4230
failed with stage
in 1 minute and 25 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
187 additions
and
35 deletions
+187
-35
Makefile
Makefile
+1
-1
board.c
boards/city/board.c
+21
-19
board.h
boards/city/board.h
+13
-15
city_defconfig
configs/city_defconfig
+152
-0
No files found.
Makefile
View file @
78c2adc5
...
...
@@ -99,7 +99,7 @@ ldflags-$(CONFIG_ARCH_LM32) = -mmultiply-enabled -mbarrel-shift-enabled \
-nostdlib
-T
$(LDS-y)
ldflags-$(CONFIG_ARCH_RISCV)
=
-march
=
rv32im
$
(
USE-COMP-INSTR-y
)
-mabi
=
ilp32
\
-nostdlib
-T
$
(
LDS-y
)
asflags-$(CONFIG_ARCH_RISCV)
+=
-march
=
rv32im
$
(
USE-COMP-INSTR-y
)
_zicsr
-mabi
=
ilp32
asflags-$(CONFIG_ARCH_RISCV)
+=
-march
=
rv32im
$
(
USE-COMP-INSTR-y
)
-mabi
=
ilp32
arch-files-$(CONFIG_ARCH_LM32)
=
$(OUTPUT).bram
$(OUTPUT).vhd
$(OUTPUT).mif
arch-files-$(CONFIG_ARCH_RISCV)
=
$(OUTPUT).bram
$(OUTPUT).vhd
$(OUTPUT).mif
...
...
boards/city/board.c
View file @
78c2adc5
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2022 Nikhef (www.Nikhef.nl)
* Author: Peter Jansweijer <peterj@nikhef.nl> based on work
* from Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "board.h"
#include "wrc.h"
#include "wrc-debug.h"
...
...
@@ -67,29 +88,10 @@ int wrc_board_early_init()
static
int
board_get_persistent_mac
(
uint8_t
*
mac
)
{
int
i
;
struct
w1_dev
*
d
;
/* Try from SDB */
if
(
storage_get_persistent_mac
(
0
,
mac
)
==
0
)
return
0
;
/* Get from one-wire (derived from unique id) */
if
(
HAS_W1
)
{
for
(
i
=
0
;
i
<
W1_MAX_DEVICES
;
i
++
)
{
d
=
wrpc_w1_bus
.
devs
+
i
;
if
(
d
->
rom
)
{
mac
[
0
]
=
0x22
;
mac
[
1
]
=
0x33
;
mac
[
2
]
=
0xff
&
(
d
->
rom
>>
32
);
mac
[
3
]
=
0xff
&
(
d
->
rom
>>
24
);
mac
[
4
]
=
0xff
&
(
d
->
rom
>>
16
);
mac
[
5
]
=
0xff
&
(
d
->
rom
>>
8
);
return
0
;
}
}
}
/* Not found */
return
-
1
;
}
...
...
boards/city/board.h
View file @
78c2adc5
...
...
@@ -22,15 +22,15 @@
#endif
/* Fixed base addresses */
#define BASE_MINIC
(DEV_BASE + 0x000)
#define BASE_EP
(DEV_BASE + 0x100)
#define BASE_SOFTPLL
(DEV_BASE + 0x200)
#define BASE_PPS_GEN
(DEV_BASE + 0x300)
#define BASE_SYSCON
(DEV_BASE + 0x400)
#define BASE_UART
(DEV_BASE + 0x500)
#define BASE_ONEWIRE
(DEV_BASE + 0x600)
#define BASE_WDIAGS_PRIV
(DEV_BASE + 0x900)
#define BASE_ETHERBONE_CFG
(DEV_BASE + 0x8000)
#define BASE_MINIC
(DEV_BASE + 0x000)
#define BASE_EP
(DEV_BASE + 0x100)
#define BASE_SOFTPLL
(DEV_BASE + 0x200)
#define BASE_PPS_GEN
(DEV_BASE + 0x300)
#define BASE_SYSCON
(DEV_BASE + 0x400)
#define BASE_UART
(DEV_BASE + 0x500)
#define BASE_ONEWIRE
(DEV_BASE + 0x600)
#define BASE_WDIAGS_PRIV (DEV_BASE + 0x900)
#define BASE_ETHERBONE_CFG
(DEV_BASE + 0x8000)
/* Board-specific parameters */
#define TICS_PER_SECOND 1000
...
...
@@ -39,7 +39,7 @@
#define CPU_CLOCK 62500000ULL
/* WR Reference clock period (picoseconds) and frequency (Hz) */
/* GENERIC_PHY_16BIT */
/*
CITY has
GENERIC_PHY_16BIT */
#define NS_PER_CLOCK 16
#define REF_CLOCK_PERIOD_PS 16000
#define REF_CLOCK_FREQ_HZ 62500000
...
...
@@ -73,16 +73,14 @@
#define SDBFS_REC 5
#define EEPROM_STORAGE
0
#define EEPROM_STORAGE
1
void
sdb_find_devices
(
void
);
void
sdb_print_devices
(
void
);
extern
int
phy_calibration_poll
(
void
);
extern
void
phy_calibration_init
(
void
);
extern
int
phy_calibration_done
(
void
);
extern
void
phy_calibration_disable
(
void
);
void
sdb_find_devices
(
void
);
void
sdb_print_devices
(
void
);
#endif
/* __BOARD_CITY_H */
configs/city_defconfig
0 → 100644
View file @
78c2adc5
#
# Automatically generated file; DO NOT EDIT.
# WR PTP Core software configuration
#
# CONFIG_ARCH_LM32 is not set
CONFIG_ARCH_RISCV=y
# CONFIG_RISCV_COMP_INSTR is not set
# CONFIG_TARGET_GENERIC_PHY_8BIT is not set
# CONFIG_TARGET_GENERIC_PHY_16BIT is not set
# CONFIG_TARGET_WR_SWITCH is not set
# CONFIG_TARGET_AFCZ_V2 is not set
# CONFIG_TARGET_ERTM14 is not set
# CONFIG_TARGET_SIS8300KU is not set
# CONFIG_TARGET_SPEC7 is not set
# CONFIG_TARGET_CLB_V2 is not set
# CONFIG_TARGET_CLB_V3 is not set
# CONFIG_TARGET_CLB_V4 is not set
# CONFIG_TARGET_PXIE_FMC is not set
# CONFIG_TARGET_WR2RF_VME is not set
CONFIG_TARGET_CITY=y
CONFIG_WR_NODE=y
CONFIG_STACKSIZE=2048
CONFIG_PRINT_BUFSIZE=256
CONFIG_RAMSIZE=131072
CONFIG_TEMP_POLL_INTERVAL=15
CONFIG_TEMP_HIGH_THRESHOLD=70
CONFIG_TEMP_HIGH_RAPPEL=60
# CONFIG_VLAN is not set
CONFIG_VLAN_NR=0
CONFIG_VLAN_1_FOR_CLASS7=0
CONFIG_VLAN_2_FOR_CLASS7=0
CONFIG_VLAN_FOR_CLASS6=0
# CONFIG_HOST_PROCESS is not set
CONFIG_EMBEDDED_NODE=y
CONFIG_WRPC_PPSI=y
CONFIG_LATENCY_ETHTYPE=291
# CONFIG_IP is not set
# CONFIG_CMD_CONFIG is not set
CONFIG_BUILD_INIT=y
CONFIG_INIT_COMMAND="ptp stop;sfp match;mode slave;ptp start"
CONFIG_HAS_BUILD_INIT=1
CONFIG_HAS_FLASH_INIT=1
CONFIG_FLASH_INIT=y
# CONFIG_AUX_DIAG is not set
# CONFIG_CMD_CALIBRATION_SHOW is not set
# CONFIG_WR_DIAG is not set
# CONFIG_WR_NODE_SIM is not set
CONFIG_ABSCAL=y
# CONFIG_LLDP is not set
# CONFIG_CMD_REFRESH is not set
# CONFIG_CMD_PPS is not set
# CONFIG_CMD_SFP_INFO is not set
# CONFIG_SFP_DOM is not set
# CONFIG_CMD_LEAPSEC is not set
# CONFIG_CMD_PTP_ADV is not set
# CONFIG_TEMP_SENSORS is not set
# CONFIG_GENERIC_SENSORS is not set
# CONFIG_W1 is not set
# CONFIG_TRACE_MSGS is not set
CONFIG_TRACE_ALL=0
CONFIG_TRACE_MAIN=0
CONFIG_TRACE_STORAGE=0
CONFIG_TRACE_DEVICES=0
CONFIG_TRACE_BOARD=0
CONFIG_TRACE_MAC=0
CONFIG_TRACE_PHY=0
#
# wrpc-sw is tainted if you change the following options
#
# CONFIG_DEVELOPER is not set
CONFIG_LTO=y
# CONFIG_PRINTF_XINT is not set
CONFIG_PRINTF_FULL=y
# CONFIG_PRINTF_MINI is not set
# CONFIG_PRINTF_NONE is not set
#
# PPSI config
#
CONFIG_ARCH="wrpc"
CONFIG_ARCH_CFLAGS=""
CONFIG_ARCH_LDFLAGS=""
#
# Options
#
#
# PTP Protocol Options
#
CONFIG_E2E=y
# CONFIG_P2P is not set
CONFIG_E2E_ONLY=y
CONFIG_HAS_P2P=0
# CONFIG_PTP_OVERWRITE_BASIC_ATTRIBUTES is not set
# CONFIG_PTP_OPT_OVERWRITE_ATTRIBUTES is not set
CONFIG_LEAP_SECONDS_VAL=37
#
# Enabled profiles
#
CONFIG_PROFILE_WR=y
# CONFIG_PROFILE_HA is not set
# CONFIG_PROFILE_CUSTOM is not set
CONFIG_PROFILE_PTP=y
CONFIG_HAS_EXT_WR=1
CONFIG_HAS_EXT_L1SYNC=0
CONFIG_HAS_EXT_NONE=0
CONFIG_HAS_PROFILE_PTP=1
CONFIG_HAS_PROFILE_HA=0
CONFIG_HAS_PROFILE_WR=1
CONFIG_HAS_PROFILE_CUSTOM=0
CONFIG_VLAN_ARRAY_SIZE=0
# CONFIG_PPSI_ASSERT is not set
CONFIG_NR_FOREIGN_RECORDS=1
CONFIG_SINGLE_FMASTER=y
CONFIG_NR_PORTS=1
CONFIG_NR_INSTANCES_PER_PORT=1
#
# Code optimization
#
CONFIG_CODEOPT_ENABLED=y
CONFIG_SINGLE_INSTANCE_PER_PORT=y
CONFIG_SINGLE_INSTANCE=y
CONFIG_SINGLE_PORT=y
# CONFIG_CODEOPT_SINGLE_PORT is not set
# CONFIG_CODEOPT_SINGLE_FMASTER is not set
# CONFIG_CODEOPT_SINGLE_INSTANCE_PER_PORT is not set
CONFIG_CODEOPT_WRPC_SIZE=y
CONFIG_CODEOPT_EXT_PORT_CONF_FORCE_DISABLED=y
CONFIG_CODEOPT_SO_FORCE_DISABLED=y
CONFIG_CODEOPT_MO_FORCE_DISABLED=y
CONFIG_CODEOPT_EPC_SO_DISABLED=y
CONFIG_OPTIMIZATION="-Os -ggdb"
# CONFIG_FAULT_INJECTION_MECHANISM is not set
# CONFIG_NO_PTPDUMP is not set
CONFIG_HAS_FAULT_INJECTION_MECHANISM=0
CONFIG_HAS_WRPC_FAULTS=0
CONFIG_HAS_CODEOPT_SINGLE_FMASTER=0
CONFIG_HAS_CODEOPT_SINGLE_PORT=0
CONFIG_HAS_CODEOPT_SINGLE_INSTANCE_PER_PORT=0
CONFIG_HAS_CODEOPT_CODEOPT_WRPC_SIZE=1
CONFIG_HAS_CODEOPT_EXT_PORT_CONF_FORCE_DISABLED=1
CONFIG_HAS_CODEOPT_SO_FORCE_DISABLED=1
CONFIG_HAS_CODEOPT_MO_FORCE_DISABLED=1
CONFIG_HAS_CODEOPT_EPC_ENABLED=0
CONFIG_HAS_CODEOPT_SO_ENABLED=0
CONFIG_ARCH_IS_WRS=0
CONFIG_ARCH_IS_WRPC=1
CONFIG_HAS_PPSI_ASSERT=0
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