- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.2k
 
riscv: Introduce Bouffalo Lab SoC and dt_bl10_devkit #37686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
    
  
     Closed
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      22cf8d6
              
                riscv: linker.ld: Fix undefined reference linker error
              
              
                nandojve f420690
              
                west: Introduce hal bouffalo lab
              
              
                nandojve 531f50f
              
                dts: riscv: bouffalolab: Add bl6 series cpu
              
              
                nandojve 52dad4f
              
                soc: riscv: bouffalolab: Add bl6 series cpu
              
              
                nandojve e3dd54c
              
                drivers: timer: Enable mtimer support for bflb cpu
              
              
                nandojve db422fd
              
                drivers: pinctrl: bouffalolab: Add bflb pinctrl driver
              
              
                nandojve 3b68a0f
              
                drivers: serial: bouffalolab: Add bflb serial driver
              
              
                nandojve b18af6e
              
                scripts: runner: Introduce blflash runner
              
              
                nandojve 6bfee9c
              
                boards: riscv: Introduce dt_bl10_devkit
              
              
                nandojve 6896bf9
              
                CODEOWNERS: Add nandojve for bouffalolab
              
              
                nandojve File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or 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 hidden or 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,4 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| board_set_flasher_ifnset(blflash) | ||
| board_finalize_runner_args(blflash) | 
  
    
      This file contains hidden or 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 hidden or 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,59 @@ | ||
| # Copyright (c) 2021 Gerson Fernando Budke <[email protected]> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| '''Bouffalo Lab flash tool (blflash) runner for serial boot ROM''' | ||
| 
     | 
||
| from runners.core import ZephyrBinaryRunner, RunnerCaps | ||
| 
     | 
||
| DEFAULT_BLFLASH_PORT = '/dev/ttyUSB0' | ||
| DEFAULT_BLFLASH_SPEED = '2000000' | ||
| 
     | 
||
| class BlFlashBinaryRunner(ZephyrBinaryRunner): | ||
| '''Runner front-end for blflash.''' | ||
| 
     | 
||
| def __init__(self, cfg, blflash='blflash', | ||
| port=DEFAULT_BLFLASH_PORT, | ||
| speed=DEFAULT_BLFLASH_SPEED): | ||
| super().__init__(cfg) | ||
| self.blflash = blflash | ||
| self.port = port | ||
| self.speed = speed | ||
| 
     | 
||
| @classmethod | ||
| def name(cls): | ||
| return 'blflash' | ||
| 
     | 
||
| @classmethod | ||
| def capabilities(cls): | ||
| return RunnerCaps(commands={'flash'}) | ||
| 
     | 
||
| @classmethod | ||
| def do_add_parser(cls, parser): | ||
| parser.add_argument('--blflash', default='blflash', | ||
| help='path to blflash, default is blflash') | ||
| parser.add_argument('--port', default=DEFAULT_BLFLASH_PORT, | ||
| help='serial port to use, default is ' + | ||
| str(DEFAULT_BLFLASH_PORT)) | ||
| parser.add_argument('--speed', default=DEFAULT_BLFLASH_SPEED, | ||
| help='serial port speed to use, default is ' + | ||
| DEFAULT_BLFLASH_SPEED) | ||
| 
     | 
||
| @classmethod | ||
| def do_create(cls, cfg, args): | ||
| return BlFlashBinaryRunner(cfg, | ||
| blflash=args.blflash, | ||
| port=args.port, | ||
| speed=args.speed) | ||
| 
     | 
||
| def do_run(self, command, **kwargs): | ||
| self.require(self.blflash) | ||
| self.ensure_output('bin') | ||
| 
     | 
||
| cmd_flash = [self.blflash, | ||
| 'flash', | ||
| self.cfg.bin_file, | ||
| '-p', self.port, | ||
| '-b', self.speed] | ||
| 
     | 
||
| self.check_call(cmd_flash) | ||
  
    
      This file contains hidden or 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
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to call str. This is already a string.