Skip to content

Commit

Permalink
Merge pull request #11 from worproject/dmac
Browse files Browse the repository at this point in the history
PL330 DMA Controller
  • Loading branch information
coolstar authored Nov 24, 2023
2 parents 900dff9 + 252e58d commit 40b5574
Show file tree
Hide file tree
Showing 16 changed files with 2,624 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/RockchipDrivers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rk3xi2c", "..\drivers\i2c\r
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rk3xgpio", "..\drivers\gpio\rk3xgpio\rk3xgpio.vcxproj", "{A80FE9DD-C140-40F6-A3F4-55A2A55BFAD4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pl330dma", "..\drivers\dma\pl330dma\pl330.vcxproj", "{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Expand All @@ -33,6 +35,12 @@ Global
{A80FE9DD-C140-40F6-A3F4-55A2A55BFAD4}.Release|ARM64.ActiveCfg = Release|ARM64
{A80FE9DD-C140-40F6-A3F4-55A2A55BFAD4}.Release|ARM64.Build.0 = Release|ARM64
{A80FE9DD-C140-40F6-A3F4-55A2A55BFAD4}.Release|ARM64.Deploy.0 = Release|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Debug|ARM64.ActiveCfg = Debug|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Debug|ARM64.Build.0 = Debug|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Debug|ARM64.Deploy.0 = Debug|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Release|ARM64.ActiveCfg = Release|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Release|ARM64.Build.0 = Release|ARM64
{58434B4F-EE73-4D1E-A78D-9FEC5CEC83C7}.Release|ARM64.Deploy.0 = Release|ARM64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
13 changes: 13 additions & 0 deletions drivers/dma/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2023 CoolStar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
3 changes: 3 additions & 0 deletions drivers/dma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ARM PL330 Driver

Tested on RK3588S
36 changes: 36 additions & 0 deletions drivers/dma/pl330dma/bitops.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* __ffs - find first bit in word.
* @word: The word to search
*
* Undefined if no bit exists, so code should check against 0 first.
*/
static unsigned long __ffs(unsigned long word)
{
int num = 0;

#if BITS_PER_LONG == 64
if ((word & 0xffffffff) == 0) {
num += 32;
word >>= 32;
}
#endif
if ((word & 0xffff) == 0) {
num += 16;
word >>= 16;
}
if ((word & 0xff) == 0) {
num += 8;
word >>= 8;
}
if ((word & 0xf) == 0) {
num += 4;
word >>= 4;
}
if ((word & 0x3) == 0) {
num += 2;
word >>= 2;
}
if ((word & 0x1) == 0)
num += 1;
return num;
}
Loading

0 comments on commit 40b5574

Please sign in to comment.