-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add milkv duo256m and duos platforms
The soc used by Duo256M and DuoS is Sophgo's sg200x. Signed-off-by: carbon <carbon@milkv.io> Co-authored-by: wcl <wangchenlong@milkv.io>
- Loading branch information
1 parent
64c581d
commit c511029
Showing
14 changed files
with
750 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. |yes| image:: ../../images/yes.png | ||
.. |no| image:: ../../images/no.png | ||
|
||
.. role:: underline | ||
:class: underline | ||
|
||
Milk-V Duo256m | ||
========== | ||
|
||
+----------------+-----------------+ | ||
| System on Chip | Sophgo SG2002 | | ||
+----------------+-----------------+ | ||
| Number GPIO | 26 | | ||
+----------------+-----------------+ | ||
| Status | Fully supported | | ||
+----------------+-----------------+ | ||
|
||
Supported Features | ||
------------------ | ||
|
||
+----------------+-----------------+ | ||
| Read / Write | |yes| | | ||
+----------------+-----------------+ | ||
| Interrupt | |yes| | | ||
+----------------+-----------------+ | ||
|
||
GPIO Mapping | ||
------------ | ||
|
||
.. image:: duo256m.jpg | ||
|
||
+----+----+-----+------+------+-----+-----+-----+----+----+-----+----+-----+----+----+----+----+-----+----+----+ | ||
| 5V | 5V | GND | 3.3V | 3.3V | N/A | N/A | GND | 27 | 26 | RUN | 22 | GND | 21 | 20 | 19 | 18 | GND | 17 | 16 | | ||
+----+----+-----+------+------+-----+-----+-----+----+----+-----+----+-----+----+----+----+----+-----+----+----+ | ||
| 0 | 1 | GND | 2 | 3 | 4 | 5 | GND | 6 | 7 | 8 | 9 | GND | 10 | 11 | 12 | 13 | GND | 14 | 15 | | ||
+----+----+-----+------+------+-----+-----+-----+----+----+-----+----+-----+----+----+----+----+-----+----+----+ | ||
|
||
Additional | ||
---------- | ||
|
||
- Blue LED: 25 | ||
|
||
Note: GPIO 25 is the system status indicator LED of Duo256M. | ||
Before using wiringX to control this LED, its blinking function needs to be disabled in the system. | ||
Otherwise, the control will not take effect and no error message will be returned. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.. |yes| image:: ../../images/yes.png | ||
.. |no| image:: ../../images/no.png | ||
|
||
.. role:: underline | ||
:class: underline | ||
|
||
Milk-V Duos | ||
========== | ||
|
||
+----------------+-----------------+ | ||
| System on Chip | Sophgo SG2002 | | ||
+----------------+-----------------+ | ||
| Number GPIO | 39 | | ||
+----------------+-----------------+ | ||
| Status | Fully supported | | ||
+----------------+-----------------+ | ||
|
||
Supported Features | ||
------------------ | ||
|
||
+----------------+-----------------+ | ||
| Read / Write | |yes| | | ||
+----------------+-----------------+ | ||
| Interrupt | |yes| | | ||
+----------------+-----------------+ | ||
|
||
GPIO Mapping | ||
------------ | ||
|
||
J3: | ||
+------+----+-----+---+-----+----+-----+----+------+-----+----+----+-----+ | ||
| 5V | 5V | GND | 8 | 10 | 12 | GND | 16 | 18 | GND | 22 | 24 | 26 | | ||
+------+----+-----+---+-----+----+-----+----+------+-----+----+----+-----+ | ||
| 3.3V | 3 | 5 | 7 | GND | 11 | 13 | 15 | 3.3V | 19 | 21 | 23 | GND | | ||
+------+----+-----+---+-----+----+-----+----+------+-----+----+----+-----+ | ||
|
||
.. image:: duos.jpg | ||
|
||
J4: | ||
+-----+-----+-----+-----+------+----+----+-----+----+----+-----+----+----+ | ||
| N/A | N/A | N/A | N/A | 3.3V | 41 | 39 | GND | 35 | 33 | GND | 29 | 27 | | ||
+-----+-----+-----+-----+------+----+----+-----+----+----+-----+----+----+ | ||
| 5V | 50 | 48 | 46 | 44 | 42 | 40 | GND | 36 | 34 | GND | 30 | 28 | | ||
+-----+-----+-----+-----+------+----+----+-----+----+----+----+----+-----+ | ||
|
||
Additional | ||
---------- | ||
|
||
- Blue LED: 0 | ||
|
||
Note: GPIO 0 is the system status indicator LED of DuoS. | ||
Before using wiringX to control this LED, its blinking function needs to be disabled in the system. | ||
Otherwise, the control will not take effect and no error message will be returned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ Milk-V | |
:maxdepth: 2 | ||
|
||
duo | ||
duo256m | ||
duos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
Copyright (c) 2024 Shenzhen Milk-V Technology Co., Ltd | ||
Author: William James <willian@milkv.io> | ||
Carbon <carbon@milkv.io> | ||
Zhang Yuntian <zhangyuntian@milkv.io> | ||
wcl <wangchenlong@milkv.io> | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#include "duo256m.h" | ||
|
||
struct platform_t *milkv_duo256m = NULL; | ||
|
||
static int map[] = { | ||
/* XGPIOA[28] XGPIOA[29] XGPIOA[19] XGPIOA[18] */ | ||
28, 29, 19, 18, | ||
|
||
/* PWR_GPIO[19] PWR_GPIO[20] PWR_GPIO[23] PWR_GPIO[22] */ | ||
115, 116, 119, 118, | ||
|
||
/* PWR_GPIO[21] PWR_GPIO[18] XGPIOC[14] XGPIOC[15] */ | ||
117, 114, 78, 79, | ||
|
||
/* XGPIOA[16] XGPIOA[17] XGPIOA[14] XGPIOA[15] */ | ||
16, 17, 14, 15, | ||
|
||
/* XGPIOA[23] XGPIOA[24] XGPIOA[22] XGPIOA[25] */ | ||
23, 24, 22, 25, | ||
|
||
/* XGPIOA[27] XGPIOA[26] PWR_GPIO[4] N/A */ | ||
27, 26, 100, -1, | ||
|
||
/* N/A PWR_GPIO[2] XGPIOB[3] XGPIOB[6] */ | ||
-1, 98, 35, 38 | ||
}; | ||
|
||
static int milkv_duo256mValidGPIO(int pin) { | ||
return milkvValidGPIO(pin, map, _sizeof(map)); | ||
} | ||
|
||
static int milkv_duo256mSetup(void) { | ||
return milkvSetup(milkv_duo256m, map, _sizeof(map)); | ||
} | ||
|
||
void milkv_duo256mInit(void) { | ||
platform_register(&milkv_duo256m, "milkv_duo256m"); | ||
|
||
milkv_duo256m->soc = soc_get("Sophgo", "SG200X"); | ||
milkv_duo256m->soc->setMap(map, _sizeof(map)); | ||
|
||
milkvInit(milkv_duo256m); | ||
|
||
milkv_duo256m->setup = &milkv_duo256mSetup; | ||
milkv_duo256m->validGPIO = &milkv_duo256mValidGPIO; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright (c) 2024 Shenzhen Milk-V Technology Co., Ltd | ||
Author: William James <willian@milkv.io> | ||
Carbon <carbon@milkv.io> | ||
Zhang Yuntian <zhangyuntian@milkv.io> | ||
wcl <wangchenlong@milkv.io> | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef __WIRINGX_MILKV_DUO256M_H_ | ||
#define __WIRINGX_MILKV_DUO256M_H_ | ||
|
||
#include "common.h" | ||
|
||
extern struct platform_t *milkv_duo256m; | ||
|
||
void milkv_duo256mInit(void); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
Copyright (c) 2024 Shenzhen Milk-V Technology Co., Ltd | ||
Author: William James <willian@milkv.io> | ||
Carbon <carbon@milkv.io> | ||
Zhang Yuntian <zhangyuntian@milkv.io> | ||
wcl <wangchenlong@milkv.io> | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#include "duos.h" | ||
|
||
struct platform_t *milkv_duos = NULL; | ||
|
||
static int map[] = { | ||
/* XGPIOA[29] 3V3 VSYS XGPIOB[20] */ | ||
29, -1, -1, 52, | ||
|
||
/* VSYS XGPIOB[21] GND XGPIOB[18] */ | ||
-1, 53, -1, 50, | ||
|
||
/* XGPIOA[16] XGPIOB[17] XGPIOA[17] XGPIOB[11] */ | ||
16, 49, 17, 43, | ||
|
||
/* XGPIOB[19] XGPIOB[12] GND XGPIOB[22] */ | ||
51, 44, -1, 54, | ||
|
||
/* XGPIOA[20] N/A XGPIOA[19] XGPIOB[13] */ | ||
20, -1, 19, 45, | ||
|
||
/* GND XGPIOB[14] XGPIOA[18] XGPIOB[15] */ | ||
-1, 46, 18, 47, | ||
|
||
/* XGPIOB[16] GND XGPIOA[28] XGPIOC[13] */ | ||
48, -1, 28, 77, | ||
|
||
/* XGPIOC[15] XGPIOC[12] XGPIOC[14] GND */ | ||
79, 76, 78, -1, | ||
|
||
/* GND XGPIOC[17] XGPIOC[21] XGPIOC[16] */ | ||
-1, 81, 85, 80, | ||
|
||
/* XGPIOC[20] GND GND XGPIOC[19] */ | ||
84, -1, -1, 83, | ||
|
||
/* PWR_GPIO[0] XGPIOC[18] PWR_GPIO[1] 3V3 */ | ||
96, 82, 97, -1, | ||
|
||
/* PWR_GPIO[2] AUDIO_IN_L XGPIOB[3] AUDIO_IN_R */ | ||
98, -1, 35, -1, | ||
|
||
/* XGPIOB[2] AUDIO_OUT_L XGPIOB[1] AUDIO_OUT_R */ | ||
34, -1, 33, -1, | ||
}; | ||
|
||
static int milkv_duosValidGPIO(int pin) { | ||
return milkvValidGPIO(pin, map, _sizeof(map)); | ||
} | ||
|
||
static int milkv_duosSetup(void) { | ||
return milkvSetup(milkv_duos, map, _sizeof(map)); | ||
} | ||
|
||
void milkv_duosInit(void) { | ||
platform_register(&milkv_duos, "milkv_duos"); | ||
|
||
milkv_duos->soc = soc_get("Sophgo", "SG200X"); | ||
milkv_duos->soc->setMap(map, _sizeof(map)); | ||
|
||
milkvInit(milkv_duos); | ||
|
||
milkv_duos->setup = &milkv_duosSetup; | ||
milkv_duos->validGPIO = &milkv_duosValidGPIO; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright (c) 2024 Shenzhen Milk-V Technology Co., Ltd | ||
Author: William James <willian@milkv.io> | ||
Carbon <carbon@milkv.io> | ||
Zhang Yuntian <zhangyuntian@milkv.io> | ||
wcl <wangchenlong@milkv.io> | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef __WIRINGX_MILKV_DUOS_H_ | ||
#define __WIRINGX_MILKV_DUOS_H_ | ||
|
||
#include "common.h" | ||
|
||
extern struct platform_t *milkv_duos; | ||
|
||
void milkv_duosInit(void); | ||
|
||
#endif |
Oops, something went wrong.