Skip to content

arch: mach-socfpga: cv_bsp_generator: fix support for Python3 #12

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

Open
wants to merge 1 commit into
base: socfpga_v2023.01
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions arch/arm/mach-socfpga/cv_bsp_generator/hps.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def handleHPSPeripheralNode(self, peripheralNode):
configNode = xmlgrok.nextElementSibling(configNode)
if configNode == None:
newLine += newLine
self.pinmuxConfigBuffer.write("#define " + unicode(config_define_name) + ' ' + '(' + str(config_define_value) + ')' + newLine)
self.pinmuxConfigBuffer.write("#define " + str(config_define_name) + ' ' + '(' + str(config_define_value) + ')' + newLine)

entry = self.pinmux_configs[name]
define_name = entry['name']
Expand All @@ -436,7 +436,7 @@ def handleHPSPinmuxNode(self, pinmuxNode):
def handleHPSPinmuxesNode(self, pinmuxesNode):
""" PinmuxesNode is a list of pinmuxNodes
"""
self.pinmuxHeaderBuffer.write( unicode("const u8 sys_mgr_init_table[] = {\n"))
self.pinmuxHeaderBuffer.write( str("const u8 sys_mgr_init_table[] = {\n"))

pinmuxNode = xmlgrok.firstElementChild(pinmuxesNode)
while pinmuxNode != None:
Expand All @@ -452,12 +452,12 @@ def handleHPSPinmuxesNode(self, pinmuxesNode):
for reg, value in self.pinmux_regs.items():
reg_count += 1
if reg_count < pinmux_regs_count:
self.pinmuxHeaderBuffer.write( unicode("\t" + str(value) + ', /* ' + reg + ' */\n' ))
self.pinmuxHeaderBuffer.write( str("\t" + str(value) + ', /* ' + reg + ' */\n' ))
else:
self.pinmuxHeaderBuffer.write( unicode("\t" + str(value) + ' /* ' + reg + ' */\n' ))
self.pinmuxHeaderBuffer.write( str("\t" + str(value) + ' /* ' + reg + ' */\n' ))

# Write the close of the pin MUX array in the header
self.pinmuxHeaderBuffer.write( unicode("};" ))
self.pinmuxHeaderBuffer.write( str("};" ))

def handleHPSClockNode(self, clockNode):
""" A clockNode may emit a #define for the name, frequency pair
Expand Down Expand Up @@ -534,7 +534,7 @@ def createFilesFromHPS(self):
elif childNode.nodeName == 'peripherals':
self.handleHPSPeripheralNode(childNode)
else:
print '***Error:Found unexpected HPS child node:%s' % childNode.nodeName
print('***Error:Found unexpected HPS child node:%s' % childNode.nodeName)
childNode = xmlgrok.nextElementSibling(childNode)

self.updateTemplate("DERIVED_DEVICE_FAMILY", self.derivedDeviceFamily)
Expand Down